jeudi 2 mars 2017

How to add the didTransition event to an existing ember app, from a chrome extension

I am trying to build an extension that runs on an ember app. I inject the proxy scrip into the content scrip. I want to get the didTransition event. Somehow it does not work. Only the didInsertElement event/hook works. I tried to create a new ember application, this worked, but destroyed the other ember app. Is there any other way to get the didTransition event?

if (typeof Ember == "object") {
    // This is not working
    Ember.Router.reopen({
        checkUrlChange: function() {
            var url = this.get("url");
            console.log('checkUrlChange', url);
        }.on("didTransition")
    });

    // This is working 
    Ember.Component.reopen({
        didInsertElement: function() {
            console.log('didInsertElement');
        }
    });
}




Aucun commentaire:

Enregistrer un commentaire