-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
50 lines (43 loc) · 1.14 KB
/
app.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
43
44
45
46
47
48
49
50
(function(){
'use strict';
var App = angular.module('routingDemoApp', ['ui.router']);
App.config(['$stateProvider', '$urlRouterProvider', function($stateProvider, $urlRouterProvider){
// For any unmatched url, send to /business
$urlRouterProvider.otherwise("/business")
$stateProvider
.state('business', {
url: "/business",
templateUrl: "business.html"
})
.state('business.products', {
url: "/products",
templateUrl: "products.html",
controller: function($scope){
$scope.products = ["Computer", "Printers", "Phones", "Bags"];
}
})
.state('business.services', {
url: "/services",
templateUrl: "services.html",
controller: function($scope){
$scope.services = ["Selling", "Support", "Delivery", "Reparation"];
}
})
.state('portfolio', {
url: "/portfolio",
views: {
"" : { templateUrl: "portfolio.html" },
"view1@portfolio": {
template: "Write whatever you want, it's your virtual company."
},
"view2@portfolio": {
templateUrl: "clients.html" ,
controller: function($scope)
{
$scope.clients = ["HP", "IBM", "MicroSoft"];
}
}
}
})
}]);
})();