我下面的教程,使用jQuery的分型文件夹内使用使用jQuery与角2
/// <reference path="../typings/tsd.d.ts" />
内app.component,但没有奏效。
尝试通过CDN在边index.html中导入库,然后使用 声明var $:any;仍然没有工作
安装的jQuery通过NPM和它道内system.config.ts像下面
paths: {
// paths serve as alias
'npm:': 'node_modules/',
'jquery:': 'node_modules/jquery/dist/jquery.slim.min.js'
},
仍然没有线索
更新:
现在我通过角安装角-cli。我没有404错误,但该应用程序仍然无法正常工作。这是在控制台
https://plnkr.co/edit/8HW67qLUF3t8zmTigXH6?p=preview
为什么你想这么做? :) –
你通过jQuery后的功能是什么? – Sami
您可以将一个导入添加到您的索引中。html文件,然后从'@ angular/platform-browser/src/facade/browser'导入{window};'并在你的angular中调用'window。$'。 –