user2751691
user2751691

Reputation: 411

Ember how to call computed property with arguements

checked: ((key, value) ->
        selected = @get 'controllers.a.selected'
        a = @get 'model'
        if arguments.length > 1
          if value
            selected.addObject a
          else
            selected.removeObject a

        return selected.contains a
      ).property('controllers.a.selected.length')

Now I am trying to call the checked property. I tried to use @controller.get('checked'), but how do I pass key, value arguments so that I can test the property. I do not know how to call it. Thanks a lot.

Upvotes: 0

Views: 233

Answers (1)

Kingpin2k
Kingpin2k

Reputation: 47367

I hate setting computed properties, I think it's a terrible pattern, but here's how it's done @controller.set('checked', 'foo').

http://emberjs.com/guides/object-model/computed-properties/#toc_setting-computed-properties

Upvotes: 1

Related Questions