Skip to content

Instantly share code, notes, and snippets.

@coop
Created July 23, 2012 09:17
Show Gist options
  • Save coop/3162755 to your computer and use it in GitHub Desktop.
Save coop/3162755 to your computer and use it in GitHub Desktop.
Getting access to form properties in Ember.js
<form>
<div>
<label for="name">Name</label>
{{view Ember.TextField valueBinding="view.name"}}
</div>
<div>
<label for="application">Application</label>
{{view Ember.TextField valueBinding="view.file" type="file"}}
</div>
<input type="submit" value="Create Applicant" />
</form>
Recruitment.NewApplicantView = Ember.View.extend({
templateName: 'new_applicant',
name: '',
file: null,
submit: function(event) {
event.preventDefault();
console.log(this.get('name'));
console.log(this.get('file'));
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment