Venciity

Tabs Inside Out Code School

Dec 18th, 2014
285
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (function() {
  2.   var app = angular.module('gemStore', []);
  3.  
  4.   app.controller('StoreController', function(){
  5.     this.products = gems;
  6.   });
  7.  
  8.   app.controller('TabController', function(){
  9.     this.tab = 1;
  10.     this.setTab = function(selectedTab){
  11.         this.tab = selectedTab;
  12.     };
  13.    
  14.     this.isSet = function(checkTab){
  15.         return this.tab === checkTab;
  16.     };
  17.    
  18.   });
  19.  
  20.   var gems = [
  21.       {
  22.         name: 'Azurite',
  23.         description: "Some gems have hidden qualities beyond their luster, beyond their shine... Azurite is one of those gems.",
  24.         shine: 8,
  25.         price: 110.50,
  26.         rarity: 7,
  27.         color: '#CCC',
  28.         faces: 14,
  29.         images: [
  30.           "images/gem-02.gif",
  31.           "images/gem-05.gif",
  32.           "images/gem-09.gif"
  33.         ],
  34.         reviews: [{
  35.           stars: 5,
  36.           body: "I love this gem!",
  37.           author: "[email protected]",
  38.           createdOn: 1397490980837
  39.         }, {
  40.           stars: 1,
  41.           body: "This gem sucks.",
  42.           author: "[email protected]",
  43.           createdOn: 1397490980837
  44.         }]
  45.       },
  46.       {
  47.         name: 'Bloodstone',
  48.         description: "Origin of the Bloodstone is unknown, hence its low value. It has a very high shine and 12 sides, however.",
  49.         shine: 9,
  50.         price: 22.90,
  51.         rarity: 6,
  52.         color: '#EEE',
  53.         faces: 12,
  54.         images: [
  55.           "images/gem-01.gif",
  56.           "images/gem-03.gif",
  57.           "images/gem-04.gif",
  58.         ],
  59.         reviews: [{
  60.           stars: 3,
  61.           body: "I think this gem was just OK, could honestly use more shine, IMO.",
  62.           author: "[email protected]",
  63.           createdOn: 1397490980837
  64.         }, {
  65.           stars: 4,
  66.           body: "Any gem with 12 faces is for me!",
  67.           author: "[email protected]",
  68.           createdOn: 1397490980837
  69.         }]
  70.       },
  71.       {
  72.         name: 'Zircon',
  73.         description: "Zircon is our most coveted and sought after gem. You will pay much to be the proud owner of this gorgeous and high shine gem.",
  74.         shine: 70,
  75.         price: 1100,
  76.         rarity: 2,
  77.         color: '#000',
  78.         faces: 6,
  79.         images: [
  80.           "images/gem-06.gif",
  81.           "images/gem-07.gif",
  82.           "images/gem-09.gif"
  83.         ],
  84.         reviews: [{
  85.           stars: 1,
  86.           body: "This gem is WAY too expensive for its rarity value.",
  87.           author: "[email protected]",
  88.           createdOn: 1397490980837
  89.         }, {
  90.           stars: 1,
  91.           body: "BBW: High Shine != High Quality.",
  92.           author: "[email protected]",
  93.           createdOn: 1397490980837
  94.         }, {
  95.           stars: 1,
  96.           body: "Don't waste your rubles!",
  97.           author: "[email protected]",
  98.           createdOn: 1397490980837
  99.         }]
  100.       }
  101.     ];
  102. })();
Advertisement
Add Comment
Please, Sign In to add comment