products.js 753 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. (function () {
  2. var app = angular.module('store-products', []);
  3. app.directive('productTitle', function () {
  4. return {
  5. restrict: 'A',
  6. templateUrl: 'product-title.html'
  7. };
  8. });
  9. app.directive('productSpecs', function () {
  10. return {
  11. restrict: 'A',
  12. templateUrl: 'product-specs.html'
  13. }
  14. });
  15. app.directive('productPanels', function () {
  16. return {
  17. restrict: 'E',
  18. templateUrl: 'product-panels.html',
  19. controller: function () {
  20. this.tab = 1;
  21. this.selectTab = function (setTab) {
  22. this.tab = setTab;
  23. };
  24. this.isSelected = function (checkTab) {
  25. return this.tab === checkTab;
  26. }
  27. },
  28. controllerAs: 'panels'
  29. }
  30. });
  31. })();