Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

README: fix valueBindings in full-page template #5

Merged
merged 1 commit into from

2 participants

@kevinansfield

No description provided.

@heartsentwined

Thanks @kevinansfield, have you tested this out? Correct me if I am wrong, but I believe that an unqualified valueBinding will go through controller, and failing that, the model. However, action logic is best implemented in the view, which is why I put view.* in the first place.

@kevinansfield

The code listed just above the changed template is:

App.SignInController = Ember.ObjectController.extend
  email: null
  password: null

  signIn: ->
    Auth.signIn
      email:    @get 'email'
      password: @get 'password'

With the properties being on the Controller, using view.* doesn't work. I had to change to unqualified valueBinding for the code sample to work.

If the auth logic should really be in the views, should the full-page examples be updated to reflect that?

@heartsentwined

oh sorry, you are right, I got mixed up with the widget-style helpers; the full-page style should indeed go through controller.

@heartsentwined heartsentwined merged commit 7e0f7f9 into heartsentwined:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 6, 2013
  1. @kevinansfield
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 2 deletions.
  1. +2 −2 README.md
View
4 README.md
@@ -205,9 +205,9 @@ App.SignInController = Ember.ObjectController.extend
<script type="text/x-handlebars" data-template-name="sign_in">
<form>
<label>Email</label>
- {{view Ember.TextField valueBinding="view.email"}}
+ {{view Ember.TextField valueBinding="email"}}
<label>Password</label>
- {{view Ember.TextField type="password" valueBinding="view.password"}}
+ {{view Ember.TextField type="password" valueBinding="password"}}
<button {{action "signIn"}}>Sign In</button>
</form>
</script>
Something went wrong with that request. Please try again.