Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/27.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
角度数据表引用错误:$未使用Dot net core angular 4模板定义_Angular_Angular Datatables - Fatal编程技术网

角度数据表引用错误:$未使用Dot net core angular 4模板定义

角度数据表引用错误:$未使用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

我已经使用VisualStudio模板创建了一个带dot net核心的Angular 4应用程序。 我想在我的应用程序中使用datatables,并尝试使用 但我收到的错误是:ReferenceError:$未定义。 我试图从“jquery”中将import*用作$;但没有起作用。 请给我一些建议。谢谢。

您不能使用.Net Core-Angular应用程序。安装程序需要
.angular_cli.json
,而且由于您没有使用
ng serve
,因此无法以这种方式工作

您可以在ASP.NET
index.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" />

请检查并让我们知道这是否有效。祝您好运。

请提供更多信息,澄清您的问题,并正确设置格式(将代码放入代码块中)。否则,很难有效地回答您的问题。见: