Create an application named myShoppingList and add a controller called myCtrl, which initializes a products array in the $scope. Use the ng-repeat directive in the HTML to display the array items.
So far, we have created an HTML list using the items from an array.
<script>
var app = angular.module(“myShoppingList”, []);
app.controller(“myCtrl”, function($scope) { $scope.products = [“Milk”, “Bread”, “Cheese”]; }); </script>
<div ng-app=”myShoppingList” ng-controller=”myCtrl”> |