سؤال

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??

هل كانت مفيدة؟

المحلول

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.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top