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


#1

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.