简体   繁体   中英

Load custom CDN in Angular 2

I'm new in Angular 2 and I have a customized CDN to load some files in my Angular app. I'm loading this CDN in my index.html and all files are loading correctly, but it returns an error like this:

Uncaught TypeError: undefined is not a function!
at module.exports (_a-function.js:2)
at module.exports (_ctx.js:4)
at _array-methods.js:24
at Array.map (es6.array.map.js:8)
at Array.toArray (prototype.js:1074)
at module.exports (_iter-define.js:39)
at Object.<anonymous> (es6.array.iterator.js:11)
at __webpack_require__ (bootstrap 8d27006…:52)
at Object.<anonymous> (array.js:22)
at __webpack_require__ (bootstrap 8d27006…:52)

Any idea about what's happening? Is it correct to load the CDN in index.html ?

Thanks

You must think that Angular2 works with TypeScript rather than JavaScript so when you try to use those libs in the CDN from Angular2 project the compiler is probably not recognising the code.

By the way I'm also a newbie on Angular2, but I believe this could be the thing.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM