Advertisement
jaxjaquez

MindU - AngularJS - Lecture2

Nov 30th, 2015
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. app.controller('HomeController', function ($scope) {
  2.     $scope.showFilters = false;
  3.     $scope.showOrHideText = "Show Filters"
  4.     $scope.selectedBeerType = "All";
  5.     $scope.selectedBeerBrand = "All";
  6.  
  7.     $scope.showOrHideFilters = function () {
  8.         $scope.showFilters = !$scope.showFilters;
  9.         $scope.showOrHideText = ($scope.showFilters ? "Hide " : "Show ") + "Filters";
  10.     }
  11.  
  12.     $scope.setBeerType = function (beerType) {
  13.         $scope.selectedBeerType = beerType;
  14.     };
  15.  
  16.     $scope.setBeerBrand = function (beerBrand) {
  17.         $scope.selectedBeerBrand = beerBrand;
  18.     };
  19.  
  20.     $scope.beers = [
  21.         {
  22.             Id: 1,
  23.             BeerType: "Stout",
  24.             ABV: 8.5,
  25.             Brand: "Calafia",
  26.             Name: "Imperial Corpus Stout",
  27.             Image: "",
  28.             Description: "Thick bold beer with notes of oak, coffee and cocoa. High level of alcohol and complex favors.",
  29.             Reviews: ["Review 1", "Review 2", "Review 3", "Review 4"]
  30.         },
  31.         {
  32.             Id: 2,
  33.             BeerType: "Stout",
  34.             ABV: 7.5,
  35.             Brand: "Karl Strauss",
  36.             Name: "Wreck Alley",
  37.             Image: "",
  38.             Description: "Chocolate/cocoa is the main flavor. Rick roasted malts. A very very tiny bit of booziness. Extremely delicious. Has a delicious flavor, without any flaws.",
  39.             Reviews: ["Review 1", "Review 2", "Review 3", "Review 4"]
  40.         },
  41.         {
  42.             Id: 3,
  43.             BeerType: "Red Ale",
  44.             ABV: 5.5,
  45.             Brand: "Calafia",
  46.             Name: "Red Sunset",
  47.             Image: "",
  48.             Description: "Malty and caramel taste. Well balanced irish beer",
  49.             Reviews: ["Review 1", "Review 2", "Review 3", "Review 4"]
  50.         },
  51.         {
  52.             Id: 4,
  53.             BeerType: "Red Ale",
  54.             ABV: 5.0,
  55.             Brand: "Karl Strauss",
  56.             Name: "Red Trolley",
  57.             Image: "",
  58.             Description: "We brew it with a half ton of caramelized malts for a rich copper color and toffee flavor. After adding the perfect mix of hops for balance, we warm ferment the beer to bring out a hint of dried raisins and currants. The complexity of flavors makes Red Trolley Ale a hearty and truly enjoyable beer",
  59.             Reviews: ["Review 1", "Review 2", "Review 3", "Review 4"]
  60.         },
  61.         {
  62.             Id: 5,
  63.             BeerType: "Red Ale",
  64.             ABV: 6.0,
  65.             Brand: "Stone",
  66.             Name: "Runation",
  67.             Image: "",
  68.             Description: "Stone Ruination IPA was the first full-time brewed and bottled West Coast double IPA on the planet. As craft beer has evolved over the years, so too have techniques for maximizing hop flavors and aromas.",
  69.             Reviews: ["Review 1", "Review 2", "Review 3", "Review 4"]
  70.         },
  71.         {
  72.             Id: 6,
  73.             BeerType: "IPA",
  74.             ABV: 7.4,
  75.             Brand: "Calafia",
  76.             Name: "",
  77.             Image: "",
  78.             Description: "This exquisite liquid patchwork of more than a dozen hops is a devastatingly fresh double IPA. Freshness is a key component of many beers—especially big, hoppy IPAs—but we've taken it further, a lot further, with this one. We brewed this IPA specifically NOT to last.",
  79.             Reviews: ["Review 1", "Review 2", "Review 3", "Review 4"]
  80.         },
  81.         {
  82.             Id: 7,
  83.             BeerType: "IPA",
  84.             ABV: 4.9,
  85.             Brand: "Karl Strauss",
  86.             Name: "",
  87.             Image: "",
  88.             Description: "This exquisite liquid patchwork of more than a dozen hops is a devastatingly fresh double IPA. Freshness is a key component of many beers—especially big, hoppy IPAs—but we've taken it further, a lot further, with this one. We brewed this IPA specifically NOT to last.",
  89.             Reviews: ["Review 1", "Review 2", "Review 3", "Review 4"]
  90.         },
  91.         {
  92.             Id: 8,
  93.             BeerType: "IPA",
  94.             ABV: 5.8,
  95.             Brand: "Stone",
  96.             Name: "Delicious",
  97.             Image: "",
  98.             Description: "While our beers are many and diverse, yet unified by overarching boldness, India pale ales are our undeniable bread and butter. The result is an intensely citrusy, beautifully bitter beer is worthy of the simple-yet-lordly title of Stone Delicious IPA",
  99.             Reviews: ["Review 1", "Review 2", "Review 3", "Review 4"]
  100.         },
  101.         {
  102.             Id: 9,
  103.             BeerType: "IPA",
  104.             ABV: 6.2,
  105.             Brand: "Stone",
  106.             Name: "Enjoy By",
  107.             Image: "",
  108.             Description: "This exquisite liquid patchwork of more than a dozen hops is a devastatingly fresh double IPA. Freshness is a key component of many beers—especially big, hoppy IPAs—but we've taken it further, a lot further, with this one. We brewed this IPA specifically NOT to last.",
  109.             Reviews: ["Review 1", "Review 2", "Review 3", "Review 4"]
  110.         },
  111.         {
  112.             Id: 10,
  113.             BeerType: "IPA",
  114.             ABV: 5.5,
  115.             Brand: "Ballast Point",
  116.             Name: "Big Eye",
  117.             Image: "",
  118.             Description: "This exquisite liquid patchwork of more than a dozen hops is a devastatingly fresh double IPA. Freshness is a key component of many beers—especially big, hoppy IPAs—but we've taken it further, a lot further, with this one. We brewed this IPA specifically NOT to last.",
  119.             Reviews: ["Review 1", "Review 2", "Review 3", "Review 4"]
  120.         },
  121.         {
  122.             Id: 11,
  123.             BeerType: "Golden Ale",
  124.             ABV: 4.2,
  125.             Brand: "Calafia",
  126.             Name: "California",
  127.             Image: "",
  128.             Description: "Our Black Marlin Porter stands out in a town known primarily for its IPA’s. We craft it from a unique blend of roasted and crystallized malts that give it a smooth, chocolaty, caramel profile. Then toss in a healthy dose of American hops to serve up full-bodied flavor worthy of its San Diego roots.",
  129.             Reviews: ["Review 1", "Review 2", "Review 3", "Review 4"]
  130.         },
  131.         {
  132.             Id: 12,
  133.             BeerType: "Golden Ale",
  134.             ABV: 4.6,
  135.             Brand: "Ballast Point",
  136.             Name: "Original",
  137.             Image: "",
  138.             Description: "Our Black Marlin Porter stands out in a town known primarily for its IPA’s. We craft it from a unique blend of roasted and crystallized malts that give it a smooth, chocolaty, caramel profile. Then toss in a healthy dose of American hops to serve up full-bodied flavor worthy of its San Diego roots.",
  139.             Reviews: ["Review 1", "Review 2", "Review 3", "Review 4"]
  140.         },
  141.         {
  142.             Id: 13,
  143.             BeerType: "Brown Ale",
  144.             ABV: 5.9,
  145.             Brand: "Calafia",
  146.             Name: "Charlie Brown Ale",
  147.             Image: "",
  148.             Description: "Our Black Marlin Porter stands out in a town known primarily for its IPA’s. We craft it from a unique blend of roasted and crystallized malts that give it a smooth, chocolaty, caramel profile. Then toss in a healthy dose of American hops to serve up full-bodied flavor worthy of its San Diego roots.",
  149.             Reviews: ["Review 1", "Review 2", "Review 3", "Review 4"]
  150.         },
  151.         {
  152.             Id: 14,
  153.             BeerType: "Brown Ale",
  154.             ABV: 6.8,
  155.             Brand: "Karl Strauss",
  156.             Name: "Karl Brown Ale",
  157.             Image: "",
  158.             Description: "Our Black Marlin Porter stands out in a town known primarily for its IPA’s. We craft it from a unique blend of roasted and crystallized malts that give it a smooth, chocolaty, caramel profile. Then toss in a healthy dose of American hops to serve up full-bodied flavor worthy of its San Diego roots.",
  159.             Reviews: []
  160.         },
  161.         {
  162.             Id: 15,
  163.             BeerType: "Brown Ale",
  164.             ABV: 6.2,
  165.             Brand: "Insurgente",
  166.             Name: "Brown",
  167.             Image: "",
  168.             Description: "Our Black Marlin Porter stands out in a town known primarily for its IPA’s. We craft it from a unique blend of roasted and crystallized malts that give it a smooth, chocolaty, caramel profile. Then toss in a healthy dose of American hops to serve up full-bodied flavor worthy of its San Diego roots.",
  169.             Reviews: []
  170.         },
  171.         {
  172.             Id: 16,
  173.             BeerType: "Pale Ale",
  174.             ABV: 5.0,
  175.             Brand: "Calafia",
  176.             Name: "Calafiero Pale Ale",
  177.             Image: "",
  178.             Description: "This decidedly American West Coast pale ale represents the next chapter in our brewing story. Showcasing the full essence of vivid Mandarina Bavaria hops plucked from the storied fields of Germany, it presents bright flavors of peach and orange against a crisp, spicy, biscuity backdrop. We’re glad you’re with us on this journey!",
  179.             Reviews: []
  180.         },
  181.         {
  182.             Id: 17,
  183.             BeerType: "Saison",
  184.             ABV: 6.0,
  185.             Brand: "Insurgente",
  186.             Name: "Saison",
  187.             Image: "",
  188.             Description: "Our Black Marlin Porter stands out in a town known primarily for its IPA’s. We craft it from a unique blend of roasted and crystallized malts that give it a smooth, chocolaty, caramel profile. Then toss in a healthy dose of American hops to serve up full-bodied flavor worthy of its San Diego roots.",
  189.             Reviews: []
  190.         },
  191.         {
  192.             Id: 18,
  193.             BeerType: "Saison",
  194.             ABV: 6.0,
  195.             Brand: "Stone",
  196.             Name: "Cali Belq",
  197.             Image: "",
  198.             Description: "Our Black Marlin Porter stands out in a town known primarily for its IPA’s. We craft it from a unique blend of roasted and crystallized malts that give it a smooth, chocolaty, caramel profile. Then toss in a healthy dose of American hops to serve up full-bodied flavor worthy of its San Diego roots.",
  199.             Reviews: []
  200.         }
  201.     ];
  202. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement