-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.module.js
More file actions
28 lines (26 loc) · 786 Bytes
/
app.module.js
File metadata and controls
28 lines (26 loc) · 786 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
(function(){
"use strict";
angular
.module("Main",
["Main.products","Main.product", "Main.cart", "ngRoute"]
)
.run(function($rootScope){
$rootScope.cartProducts = {};
})
.config(function($routeProvider){
$routeProvider
.when("/product/:id", {
templateUrl: './products/product.html',
controller: 'productController'
})
.when("/checkout", {
templateUrl: "./checkout/checkout.html",
controller: "cartController"
})
.when("/", {
templateUrl: './products/products.html',
controller: 'productsController'
})
.otherwise({ redirectTo: '/' });
})
}());