Skip to content

Instantly share code, notes, and snippets.

@DamnedScholar
Created September 21, 2016 10:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DamnedScholar/52361ef5a2ff2c207bd00ccf70c962fd to your computer and use it in GitHub Desktop.
Save DamnedScholar/52361ef5a2ff2c207bd00ccf70c962fd to your computer and use it in GitHub Desktop.
export class Menu {
constructor() {
// The constructor() should establish variables for the class. It's the place to inject dependencies or pull in data that you'll use later.
this.intro = "This is the menu for Carrie's.";
this.menuItems = [
{
slug: "moroccanrolls",
name: "Moroccan Rolls",
img: "http://img-fotki.yandex.ru/get/5607/5091629.6b/0_612e6_b9039c0d_M.jpg",
imgSlice: "http://colourlovers.com.s3.amazonaws.com/images/patterns/2693/2693008.png",
blurb: "Our signature, perennial appetizer is a tube of crispy phyllo dough filled with savory herbs and served with a creamy dill sauce. Each order comes with two.",
price: "3.95"
},
{
slug: "crepes",
name: "Vietnamese Crepes with Mushroom Filling",
img: "http://img-fotki.yandex.ru/get/5607/5091629.6b/0_612e6_b9039c0d_M.jpg",
imgSlice: "http://colourlovers.com.s3.amazonaws.com/images/patterns/2693/2693008.png",
blurb: "<h5>Gluten Free - Vegan</h5>A mung bean crepe wrapped around richly flavored mushroom filling and mung bean sprouts. Mildly spicy.",
price: "7.95"
}
];
}
activate(params, routeConfig) {
let i = 0;
while (i < this.menuItems.length) {
console.log(this.menuItems[i].slug + " is testing against " + params.item)
if (this.menuItems[i].slug === params.item) {
console.log("There's a match!")
}
i++
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment