How to integrate Cordova/Phonegap plugins within Angular/Ionic the right way?

I’m using the following code to bridge from the global function to an angular service:

window.onNotificationGCM = function (event) {
    var pushService = angular.element(document.querySelector('body')).injector()
        .get('PushNotification');
    pushService.onNotificationGCM(event);
};

But perhaps there is a better way to do so?
Edit: add


            
1 Like