bcherny / bcherny/ngimport

Error when:: import {$http, $log} from 'ngimport'

Open
#13 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
100
Forks
5
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the two imports and inspect index.js at the angular.module call, using the application.js and analytics.js stack entries to trace how the bundle loads Angular. Compare the runtime Angular value with the expected module API. Done means the imports load without the browser TypeError and Angular services remain usable.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, typescript, webpack
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.