-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
42 lines (34 loc) · 1.04 KB
/
script.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// create the module and name it somshApp
var somsApp = angular.module('somsApp', ['ngRoute']);
// configure our routes
somsApp.config(function($routeProvider) {
$routeProvider
// route for the home page
.when('/', {
templateUrl : 'home.html',
controller : 'mainController'
})
// route for the about page
.when('/about', {
templateUrl : 'about.html',
controller : 'aboutController'
})
// route for the contact page
.when('/contact', {
templateUrl : 'contact.html',
controller : 'contactController'
});
});
var mainController = function($scope) {
$scope.message = 'This is Home Page.';
};
var aboutController = function($scope) {
$scope.message = 'This is About Us Page.';
};
var contactController = function($scope) {
$scope.message = 'This is Contact Us Page.';
};
// create the controller
somsApp.controller('mainController', mainController);
somsApp.controller('aboutController', aboutController);
somsApp.controller('contactController', contactController);