Carelessness in example-apps


#1

Hi,

I had the problem, that my ionic app works fine in the Browser, but after minifying the js, it was broken. The mistake is in the app.js of the example:

.run(function ($ionicPlatform) {
$ionicPlatform.ready(function () {
    // Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
    // for form inputs)
    if (window.cordova && window.cordova.plugins.Keyboard) {
        cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
    }
    if (window.StatusBar) {
        // org.apache.cordova.statusbar required
        StatusBar.styleDefault();
    }
});

But it should be:

.run(['$ionicPlatform', function ($ionicPlatform) {
$ionicPlatform.ready(function () {
    // Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
    // for form inputs)
    if (window.cordova && window.cordova.plugins.Keyboard) {
        cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
    }
    if (window.StatusBar) {
        // org.apache.cordova.statusbar required
        StatusBar.styleDefault();
    }
});
}]);

Now the app works fine after minifying.


#2

I wouldn’t say there’s anything wrong with that notation. A lot of people prefer the succinctness of it.

In any case, take a look at https://github.com/olov/ng-annotate for future reference.


#3

Hey there, yeah adding something like ng-annotate should solve things.
The example apps are just to get you started.