Implementing the Shopping View
The shopping view shown in Listing 28.12 is the main view for the shopping application. In fact, the user never actually leaves this page; rather, the content changes, based on the partial views described in the following sections.
The header of the view registers the <html ng-app="myApp">
element with the AngularJS myApp
application and loads the cart_styles.css
file. The <body>
element initializes the AngularJS ng-controller="shoppingController"
to provide the functionality to interact with the products, shopping cart, checkout, and orders.
The page content changes using the following ng-include
directive that maps to $scope.content
, and the content
variable in the scope can be set to any template file on the ...
Get Node.js, MongoDB, and AngularJS Web Development now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.