app.js.txt -------- // Define the AngularJS module and inject ngRoute var app = angular.module("routingExampleApp", ["ngRoute"]); // Configure the routes app.config(function ($routeProvider) { $routeProvider .when("/home", { templateUrl: "partials/home.html", controller: "HomeController", }) .when("/about", { templateUrl: "partials/about.html", controller: "AboutController", }) .when("/contact", { templateUrl: "partials/contact.html", controller: "ContactController", }) .otherwise({ redirectTo: "/home", }); }); // Define controllers app.controller("MainController", function ($scope) { // MainController logic }); app.controller("HomeController", function ($scope) { $scope.message = "Welcome to the Home Page!"; }); app.controller("AboutController", function ($scope) { $scope.message = "Learn more about us on the About Page."; }); app.controller("ContactController", function ($scope) { $scope.message = "Contact us through this form."; }); index.htm.txt --------
{{ message }}
{{ message }}
{{ message }}