Yesterday I created a registration form, I assume that you want to build asynchronous.
I started with this gist , the API has changed a bit since then, but now it looks a bit different:
JavaScript:
App = Ember.Application.create({}); App.loginController = Ember.Object.create({ // do login stuff }); App.LoginFormView = Ember.View.extend({ username: null, password: null, submitLogin: function() { var username = this.get('login'); var password = this.get('password'); console.log('Login: ' + login + ' Password: ' + password); // do the login, probably by $.post()ing to your login page }, });
Steering wheels:
<script type="text/x-handlebars" data-template-name="login"> {{#view App.LoginFormView tagName="form"}} <label>Username:</label> {{view Ember.TextField valueBinding="view.username"}} <label>Password:</label> {{view Ember.TextField type="password" valueBinding="view.password"}} {{#view Ember.Button target="parentView" action="submitLogin"}}Login{{/view}} {{/view}} </script>
As for your other questions, I can't fully answer them (I'm relatively new to Ember.js), but I think that the main philosophy of Ember.js is mainly the architectural environment (but with a good tie -ins to Handlebars.js) rather than the architectural and user interface, like its predecessor, SproutCore .
source share