简体   繁体   English

在Angular 2中加载自定义CDN

[英]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. 我是Angular 2的新用户,我有一个自定义的CDN,可以在Angular应用程序中加载一些文件。 I'm loading this CDN in my index.html and all files are loading correctly, but it returns an error like this: 我正在我的index.html加载此CDN,并且所有文件都正确加载,但是它返回如下错误:

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 ? index.html加载CDN是否正确?

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. 您必须认为Angular2使用TypeScript而不是JavaScript,因此,当您尝试使用Angular2项目CDN中的那些库时,编译器可能无法识别代码。

By the way I'm also a newbie on Angular2, but I believe this could be the thing. 顺便说一下,我也是Angular2的新手,但我相信这可能就是问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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