forked from zafarali/learning-angular
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path07-1-routing.html
More file actions
33 lines (31 loc) · 902 Bytes
/
07-1-routing.html
File metadata and controls
33 lines (31 loc) · 902 Bytes
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
<!DOCTYPE html>
<html>
<head>
<title>ng-view</title>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.0-beta.11/angular.min.js"></script>
<script src="https://code.angularjs.org/1.3.0-beta.11/angular-route.min.js"></script>
<script>
var app = angular.module('app', ['ngRoute']);
app.config(['$routeProvider', function($routeProvider){
$routeProvider.when('/',{
templateUrl:'partial3.html',
controller:'BasicCtrl'
})
.when('/sup',{
template: '<h3>Whats up!</h3>'
})
.otherwise({
template:'<h3>Page could not be found </3 </h3>'
})
;
}]);
app.controller('BasicCtrl', function($scope){
$scope.dt = {title:'This application is very useful'};
});
</script>
</head>
<body ng-app='app'>
<a href="#">Home</a> | <a href="#/sup">Ask me whats up</a> | <a href="#/what">Page that doesn't exist</a><br />
<ng-view></ng-view>
</body>
</html>