Couldn't access and modify model data inside Controller


#1

I have tried example program using Ember as in http://jsbin.com/IyeNucoj/3/edit

I need to access and modify some model properties like isSingleLine, isMultiLine, isPickList in controller actions.

It throws exception like #Object doesn’t has set method. I couldn’t figure out the problem what i did


#2

@susai Try setting and getting of values in POJOs using Em.set(context, property, value) and Em.get(context, property).


#3

@susai, you can do as @SelvaG has told, or you can use an itemController and handle the action in the itemController.


#4

Yes its working. The problem is i am not using Ember object as model. I am using javascript object directly. So Em.set() and Em.get() used to set and get JavaScript objects. Thanks :smile:


#5

I couldn’t understand why i need to create itemController .