index.html 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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-init="tab = 1">
  23. <ul class="nav nav-pills">
  24. <li ng-class="{ active:tab === 1 }"><a ng-click="tab = 1">Description</a></li>
  25. <li ng-class="{ active:tab === 2 }"><a ng-click="tab = 2">Specifications</a></li>
  26. <li ng-class="{ active:tab === 3 }"><a ng-click="tab = 3">Reviews</a></li>
  27. </ul>
  28. <div class="panel" ng-show="tab === 1">
  29. <p>{{ product.description }}</p>
  30. </div>
  31. <div class="panel" ng-show="tab === 2">
  32. <p>None yet</p>
  33. </div>
  34. <div class="panel" ng-show="tab === 3">
  35. <p>None yet</p>
  36. </div>
  37. </section>
  38. <!-- Image Gallery -->
  39. <div class="gallery" ng-show="product.images.length">
  40. <img class="img img-circle img-thumbnail center-block"
  41. ng-src="{{product.images[0]}}"/>
  42. <ul class="clearfix">
  43. <li class="small-image pull-left thumbnail"
  44. ng-repeat="image in product.images"><img ng-src="{{image}}"/></li>
  45. </ul>
  46. </div>
  47. </div>
  48. </div>
  49. </body>
  50. </html>