Update router.js to bc22bb4d5 For didTransition #3453

Merged
merged 1 commit into from Sep 26, 2013

Projects

None yet

2 participants

@mixonic
Member
mixonic commented Sep 20, 2013

Update the router.js for tildeio/router.js#52

Allows:

App.ApplicationRoute = Ember.Route.extend({
  actions: {
    didTransition: function(){
      var router = this.router;
      Ember.run.once(function(){
        // Track this pageview with Google analytics
        _gaq.push(['_trackPageview', router.get('url')]);
      });
    }
  }
});

App.LeafyRoute = Ember.Route.extend({
  actions: {
    didTransition: function(){
      // Just to give an idea, I have not done this.
      this.controllerFor('breadcrumbs').send('addCrumb', 'leafy');
      return true; // Bubble to track analytics
    }
  }
});
@stefanpenner stefanpenner merged commit 45e8ed6 into emberjs:master Sep 26, 2013

1 check passed

default The Travis CI build passed
Details
@mixonic mixonic deleted the mixonic:didTransitionAction branch Sep 26, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment