Skip to content
This repository was archived by the owner on May 11, 2018. It is now read-only.
This repository was archived by the owner on May 11, 2018. It is now read-only.

Property binding on Model object does not work #20

@tshi0912

Description

@tshi0912

For example:

App.User = Ember.Resource.extend({
resourceUrl: '/users',
resourceName: 'user',
resourceProperties: ['name', 'selected']
});

App.UserController = Ember.ResourceController.extend({

selecteds: function(){
    var users = this.get('content');
    return users.filterProperty('selected', true);
}.property('content.@each.selected')

})

As the propery 'selected' is not prepared for Ember when initializing the observer, the property binding on 'content.@each.selected' won't work any more.
To fix the problem, you should declared the property you wanna binding explicitly, such as:

App.User = Ember.Resource.extend({
resourceUrl: '/users',
resourceName: 'user',
resourceProperties: ['name', 'selected'],
selected: false
});

I suggest the author to add this trick on the README.md, since l think lots of people will encounter this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions