index.html 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <!DOCTYPE html>
  2. <html ng-app="gemStore">
  3. <head lang="en">
  4. <meta charset="UTF-8">
  5. <title>AngularJS Store</title>
  6. <link rel="stylesheet"
  7. type="text/css"
  8. href="../bootstrap/dist/css/bootstrap.min.css"/>
  9. <link rel="stylesheet" type="text/css" href="app.css"/>
  10. <script type="text/javascript" src="../angular/angular.min.js"></script>
  11. <script type="text/javascript" src="app.js"></script>
  12. </head>
  13. <body ng-controller="StoreController as store">
  14. <!-- Products Container -->
  15. <div class="list-group" ng-hide="store.product.soldOut">
  16. <!-- Product container -->
  17. <div class="list-group-item" ng-repeat="product in store.products">
  18. <h3>
  19. {{product.name}}
  20. <em class="pull-right">{{product.price | currency}}</em>
  21. </h3>
  22. <section ng-controller="PanelController as panel">
  23. <ul class="nav nav-pills">
  24. <li ng-class="{ active:panel.isSelected(1) }"><a ng-click="panel.selectTab(1)">Description</a></li>
  25. <li ng-class="{ active:panel.isSelected(2) }"><a ng-click="panel.selectTab(2)">Specifications</a></li>
  26. <li ng-class="{ active:panel.isSelected(3) }"><a ng-click="panel.selectTab(3)">Reviews</a></li>
  27. </ul>
  28. <div class="panel" ng-show="panel.isSelected(1)">
  29. <h4>Description</h4>
  30. <p>{{ product.description }}</p>
  31. </div>
  32. <div class="panel" ng-show="panel.isSelected(2)">
  33. <h4>Specifications</h4>
  34. <p>None yet</p>
  35. </div>
  36. <div class="panel" ng-show="panel.isSelected(3)">
  37. <h4>Reviews</h4>
  38. <p>None yet</p>
  39. </div>
  40. </section>
  41. <!-- Image Gallery -->
  42. <div class="gallery" ng-show="product.images.length">
  43. <img class="img img-circle img-thumbnail center-block"
  44. ng-src="{{product.images[0]}}"/>
  45. <ul class="clearfix">
  46. <li class="small-image pull-left thumbnail"
  47. ng-repeat="image in product.images"><img ng-src="{{image}}"/></li>
  48. </ul>
  49. </div>
  50. </div>
  51. </div>
  52. </body>
  53. </html>