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

Pass Data from a form template to form's JavaScript - component

$
0
0

@Rafal_P wrote:

Hello , I'm creating a component which is a form, this is an example of my code:
template of component:
<label> Detector type</label>
{{input type="text" class="form-control" value=s_Typ_Detektora}}
<button type="submit" type="button" class="btn btn-success" {{action "doSave"}}>Save</button>

JavaScript file:
actions: {
doSave() {
var typ= this.get('s_Typ_Detektora');
alert(typ);
}
}

The alert window is showing "Undefined"

What can i do to save the parameters?
Greetings, Rafał

Solved:
There was a problem with my app, I didn't knew why but when I've created a new app, the same code works perfect.

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4829

Trending Articles