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

How to get value of input ember

$
0
0

@chiholiu wrote:

Wanted to get the input value, but looking at the console.log it show that this value is undefined. Anyone here who know how to solve that.

import Route from ‘@ember/routing/route’;

export default Route.extend({ actions: { addProduct: function() { var product = this.get(‘product’); console.log(product); } } });

Product {{input type="text" class="form-control" value=product placeholder="Product Name"}}
<div class="form">
	<label>Price</label>
	{{input type="text" class="form-control" value="price" placeholder="Price"}}
</div>

<div class="form">
	<label>Amount</label>
	{{input type="text" class="form-control" value="amount" placeholder="Add Task"}}
</div>
<button {{action 'addProduct'}} class="add-button">Submit</button>

Posts: 3

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 4830

Trending Articles