File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 11
11
< script src ="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.17/angular.min.js "> </ script >
12
12
13
13
< script >
14
+ //here we create an app called 'shop'
15
+ var app = angular . module ( 'shop' , [ ] ) ;
14
16
15
17
//injecting the $scope into the Shop controller
16
- function Shop ( $scope ) {
18
+ app . controller ( 'Cart' , function ( $scope ) {
17
19
18
20
//this array holds the available items
19
21
$scope . available = [
47
49
}
48
50
return sum ;
49
51
}
50
- }
52
+ } ) ;
51
53
</ script >
52
54
53
55
54
56
</ head >
55
- < body ng-app ="">
56
- < div id ="wrapper " ng-controller ="Shop ">
57
+ < body ng-app ="shop ">
58
+ < div id ="wrapper " ng-controller ="Cart ">
57
59
< div id ="suggested ">
58
60
< div ng-repeat ="item in available ">
59
61
<!--ng-repeat iterates over the whole $scope.available array-->
You can’t perform that action at this time.
0 commit comments