1
我是Emberjs的新手,我需要一些建議。從emberjs表格獲取價值
我嘗試使用這個插件https://github.com/indexiatech/ember-forms
所以我創建了我的形式:
{{#em-form model=sessions submit_button=false}}
{{em-input property="email" type=email label="Email" placeholder="Entrer votre email..."}}
{{em-input property="password" type="password" label="Mot de passe" placeholder="Enter votre password..."}}
<div class="form-actions">
<input {{bind-attr disabled=isntValid}} type="submit" class="btn btn-primary" value="Se connecter">
</div>
{{/em-form}}
,所以我有一個控制器趕上提交一份行動:
export default Ember.Controller.extend({
actions: {
submit: function(){
alert(this.get('sessions.email'));
}
}
});
我的問題是隻是我不明白如何從我的表單打印我的價值?我嘗試this.get('email')
或this.get('sessions.email')
,但總是在我的警報框中獲得undefined
任何幫助都會很棒!謝謝!
我得到了'undefined'發送動作
,然後趕上行動時,我這樣做... –
這已經有一段時間了,因爲我已經在ember中工作過,但是如果它不是handlebar/ember,它應該不會是'{{#em-form model = sessions submit_button = false action「foo」}} // not action =「foo」'不確定如果這有所作爲,但它是值得一試的@Kaëris – wenincode
不,你不能在我的日誌中我有這個味精'期待'E QUALS',得到'STRING'',但感謝您試圖幫助:) –