exAres
exAres

Reputation: 4926

how to initialize parent template's properties in emberjs controller?

Assuming that I have parent application template and in it's outlet there is users template. Now when I load users route, I want to change properties of application template too, which are outside of user's scope. How can I modify application properties from users controller??

Upvotes: 0

Views: 164

Answers (1)

sheldonbaker
sheldonbaker

Reputation: 1079

Try using controllerFor in the setupController hook in your user route:

UserRoute = Ember.Route.extend
  setupController: (controller, model) ->
    @_super(controller, model)

    @controllerFor('application').set('foo', 'bar')

You could also check out the needs API.

Upvotes: 1

Related Questions