How does a child controller access its parent controller in ember.js -


I have some properties on my parents' controller that my children want to access the controller.

I want to use it like this:

  app App Controller = Amber Object Controller Extension ({prop1: "someProp", prop2: "someotherprrop", is needed: ["children"]}); App.ChildController = Ember.ObjectController.extend ({prop1: Ember.computed.alias ("parentController.prop1"), prop 2: amber dotput alias ("parentController.prop2"),});   

How can I use those properties?

- Edit --- Does it assume that I always need a frequency of controller?

You need to use something in the array. Use this ('controller.' Some 'controller'). I think the above is slightly behind because you want the child to have access to the App Controller.

  App.ChildController = Ember.ObjectController.extend ({needs: ['application'] prop1: Ember.computed.alias ("controllers.application.prop1"), prop2: Ember.computed .alias ("controllers.application.prop2"),});    

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -