@leschirmeur wrote:
Hi there!
In an Ionic project we are extending the global angular object like this:
angular .module('demo') .config(extendAngular); function extendAngular() { angular.isUndefinedOrNull = function (val) { return angular.isUndefined(val) || val === null; }; angular.isCordovaSupported = function () { return angular.isDefined(window.cordova); }; }By doing so, we can call angular.isUndefinedOrNull() and angular. isCordovaSupported from anywhere within the app.
Is this a good practice? If not, what would be better approaches to accomplish the same?
Posts: 2
Participants: 2