Reputation: 59
I'm unable to import from a non angular module.
app.components.ts
Folder
Node_Modules -> array- slice
import {array-slice}from 'array-slice' <- Doesn't work
import {Http,Response} from '@angular/http' <-- Works
Upvotes: 1
Views: 1137
Reputation: 1899
try
import slice = require('array-slice');
the { Http, Response }
syntax only works for es6 modules with multiple named exports. The following would also work in typescript
import * as slice from 'array-slice'
but read details here about why this is not the best approach - New es6 syntax for importing commonjs / amd modules i.e. `import foo = require('foo')`
Upvotes: 3