Window.plugins is undefined in controller on app start


#1

I’m trying to initialize plugins on app start in controller:

angular.module('starter.controllers', [])
.controller('AppCtrl', function ($scope) {
    console.log(window.plugins); // throws undefined 
}

I’m listening on device:
adb logcat CordovaLog:D *:S

D/CordovaLog(30514): file:///android_asset/www/js/controllers.js: Line 179 : undefined

but if I check for window.plugins in some other controller on some input event, plugins are defined.

So plugins are asynchrony initialized some time after controller AppCtrl finish rendering view.

How can I setup my plugin? Is there something OnPluginsReady to call in controller?


#2

Same problem. Did you resolve it?