ngimport
ngimport copied to clipboard
Error when:: import {$http, $log} from 'ngimport'
When i am importing ngimport like given getting and error
import {IPromise} from 'angular'
import {$http, $log} from 'ngimport'
Error on browser console
Uncaught TypeError: angular.module is not a function
at Object.124 (index.js:11)
at __webpack_require__ (bootstrap be5679f8ce158294b682:19)
at Object.123 (application.js:16)
at __webpack_require__ (bootstrap be5679f8ce158294b682:19)
at Object.245 (analytics.js:1)
at __webpack_require__ (bootstrap be5679f8ce158294b682:19)
at bootstrap be5679f8ce158294b682:62
at bootstrap be5679f8ce158294b682:62
And if we use a debugger on that line which has the error angular is an empty object
Hey @umar-siddiqui! How can I reproduce this? Can you link a repro case on StackBlitz
Hi @bcherny Below is the link to the repo as requested using [email protected]
https://stackblitz.com/edit/react-knhadu
even in the case of newer angular version (1.7) getting below error
Error in index.js (16:10)
Cannot read property 'get' of undefined
but would want it to work for 1.3.13 specifically.
Thanks @umar-siddiqui! A few things:
- Don't forget to bootstrap your Angular app.
- We only support Angular 1.5+. If you'd like to add support for older Angular versions, feel free to submit a Pull Request.
- Are you using Webpack? Something seems to have changed, where individual exports don't work anymore. For now, using a default export fixes this.
See fixed demo here: https://stackblitz.com/edit/react-zdvaty