Make sure $q is a constructor (1.3+). Throw if it isn't.
$ npm install angular-assert-q-constructor
angular
.module('myApp', [])
.run(function (assertQConstructor) {
assertQConstructor()
})
If $q
is a function, this is a noop. Otherwise (i.e. Angular <1.3) it will throw the message
.
Type: string
Default: '$q is not a function'