Html 角度6使用数据表

Html 角度6使用数据表,html,angular,typescript,angular-datatables,Html,Angular,Typescript,Angular Datatables,我是angular的新手,我尝试在我的应用程序中使用datatables,但是由于某些原因,我遇到了一个错误:error TypeError:$(…)。DataTable不是一个函数。。。 我已经在互联网上搜索了3个小时,所有的答案都发布了,比如:在我的组件中从“jquery”添加import*作为jquery,但是仍然不起作用,非常感谢您的帮助 index.html <!doctype html> <html lang="en"> <head> <m

我是angular的新手,我尝试在我的应用程序中使用datatables,但是由于某些原因,我遇到了一个错误:error TypeError:$(…)。DataTable不是一个函数。。。 我已经在互联网上搜索了3个小时,所有的答案都发布了,比如:在我的组件中从“jquery”添加import*作为jquery,但是仍然不起作用,非常感谢您的帮助

index.html

<!doctype html>
<html lang="en">

<head>
<meta charset="utf-8">
<title>DoPayroll</title>
<base href="/">

<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<link rel="icon" type="image/x-icon" href="favicon.ico">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font- 
 awesome.min.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.2/css/all.css"
integrity="sha384-fnmOCqbTlWIlj8LyTjo7mOUStjsKC4pOpQbqyi7RrhN7udi9RwhKkMHpvLbHG9Sr" 
crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384- 
KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"></script>

</head>

<body>
  <app-root></app-root>
</body>

</html>

你这样做了吗:这正是我所遵循的,出于某种原因,我仍然会遇到这个错误,请尝试从“jquery”中以$形式导入这个
import*
要使这一行正常工作,您需要添加
package.json
文件
“jquery”
“@types/jquery”
插件。如果它没有帮助,那么就共享您试图执行的代码。实际上,这是有效的!!,,谢谢兄弟
"styles": [
          "src/styles.css",
          "node_modules/angular-bootstrap-md/assets/scss/bootstrap/bootstrap.scss",
          "node_modules/angular-bootstrap-md/assets/scss/mdb.scss",
          "node_modules/ngx-toastr/toastr.css",
          "node_modules/bootstrap/dist/css/bootstrap.min.css",
          "node_modules/datatables.net-dt/css/jquery.dataTables.css"
        ],

"scripts": [
          "node_modules/jquery/dist/jquery.js",
          "node_modules/datatables.net/js/jquery.dataTables.js"
        ]