角度数据表引用错误:$未使用Dot net core angular 4模板定义
我已经使用VisualStudio模板创建了一个带dot net核心的Angular 4应用程序。 我想在我的应用程序中使用datatables,并尝试使用 但我收到的错误是:ReferenceError:$未定义。 我试图从“jquery”中将import*用作$;但没有起作用。 请给我一些建议。谢谢。您不能使用.Net Core-Angular应用程序。安装程序需要角度数据表引用错误:$未使用Dot net core angular 4模板定义,angular,angular-datatables,Angular,Angular Datatables,我已经使用VisualStudio模板创建了一个带dot net核心的Angular 4应用程序。 我想在我的应用程序中使用datatables,并尝试使用 但我收到的错误是:ReferenceError:$未定义。 我试图从“jquery”中将import*用作$;但没有起作用。 请给我一些建议。谢谢。您不能使用.Net Core-Angular应用程序。安装程序需要.angular_cli.json,而且由于您没有使用ng serve,因此无法以这种方式工作 您可以在ASP.NETindex
.angular_cli.json
,而且由于您没有使用ng serve
,因此无法以这种方式工作
您可以在ASP.NETindex.cshtml
文件中添加CDN.js包:
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" type="text/javascript"></script>
<script src="https://cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js" type="text/javascript"></script>
<link rel="stylesheet" href="https://cdn.datatables.net/1.10.16/css/jquery.dataTables.min.css" />
请检查并让我们知道这是否有效。祝您好运。请提供更多信息,澄清您的问题,并正确设置格式(将代码放入代码块中)。否则,很难有效地回答您的问题。见: