Quantcast
Channel: Ember.JS - Latest topics
Viewing all articles
Browse latest Browse all 4836

How to set action?

$
0
0

@tom_berry wrote:

I have created this but i don't know how can i give action to each links. When i click on BreakFast, it should only show me 3 search box(BreadType, cheeseType and meatType) only and other should hide. same for Lunch and Drinks.
i have also created route for menu in router.

--------------/////application.hbs

 <h1>Welcome!!</h1>
     {{#link-to 'menu'}}BreakFast{{/link-to}}
     {{#link-to 'menu'}}Lunch{{/link-to}}
     {{#link-to 'menu'}}Drinks{{/link-to}}
    {{outlet}}

-------------/////menu.hbs

<div>
    	<p>Hello from BreakFast</p>
    	<label>
    		Bread Type:{{input value=bread}}
    		Cheese Type:{{input value=cheese}}
    		Meat Type:{{input value=meat}}
    	</label>
    </div>
<div>
	<p>Hello from Lunch</p>
	<label>
		Calories:{{input value=cal}}
		Price:{{input value=price}}
		Veg/Non-veg:
		<select>
			<option>V</option>
			<option>N</option>
		</select>
	</label>
</div>
<div>
	<p>Hello from Drinks</p>
	<label>
		Drink Name:{{input value=name}}
		Price :{{input value=price}}
		Ice: <select><option>Y</option>
					<option>N</option>
			</select>
	</label>
</div>

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 4836

Trending Articles