forked from thestrugglingblack/basic_ang
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathscript.js
More file actions
18 lines (15 loc) · 670 Bytes
/
script.js
File metadata and controls
18 lines (15 loc) · 670 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
var app = angular.module("computer", ['ngRoute'])
//the array shows the dependency needed in this app.
.config(['$routeProvider', function($routeProvider){
//dependency injected for the configuration of the web app
$routeProvider.
when('/main', { //=>when the url says /main
templateUrl: 'main.html', //=> render this template
controller: 'MainCtrl' //=> and bring about this controller
}).otherwise({redirectTo:'/main'})
// we define if nothing is routed so ng-view will display /main
//the above code basically setup the routes
}])
.controller('MainCtrl', [ '$scope',function($scope){
console.log('This is the MainCtrl');
}]);