Skip to content

Commit ce54e0d

Browse files
committed
fixes app creation into the right format
1 parent 7cb442d commit ce54e0d

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

01-1-shopping.html

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@
1111
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.17/angular.min.js"></script>
1212

1313
<script>
14+
//here we create an app called 'shop'
15+
var app = angular.module('shop', []);
1416

1517
//injecting the $scope into the Shop controller
16-
function Shop($scope){
18+
app.controller('Cart', function($scope){
1719

1820
//this array holds the available items
1921
$scope.available = [
@@ -47,13 +49,13 @@
4749
}
4850
return sum;
4951
}
50-
}
52+
});
5153
</script>
5254

5355

5456
</head>
55-
<body ng-app="">
56-
<div id="wrapper" ng-controller="Shop">
57+
<body ng-app="shop">
58+
<div id="wrapper" ng-controller="Cart">
5759
<div id="suggested">
5860
<div ng-repeat="item in available">
5961
<!--ng-repeat iterates over the whole $scope.available array-->

0 commit comments

Comments
 (0)