我正在尝试在我的应用程序中使用ngTable,并执行以下步骤:
1)导入ngTable css文件
2)导入ngTable.js文件
3)将'ngTable‘添加到我的应用程序(’angular.module‘,xxx,yyy,'ngTable’,就像我对无数其他库所做的那样
4)将粘贴示例代码复制到我的控制器中(并注入'ngTableParams')
结果:当我试图加载页面时,我得到了:
Uncaught Error: [$injector:modulerr] Failed to instantiate module app due to:
Error: [$injector:modulerr] Failed to instantiate module ngTable due to:
Error: [$injector:nomod] Module 'ngTable' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.我到处看了看,但什么也没找到。我似乎不明白为什么这不管用...我将非常感谢您的任何意见。
发布于 2019-04-27 10:42:48
我得到了相同的错误,直到我开始加载ngTable之后加载角度本身。
下面是我的index.html中突出显示该解决方案的一段代码片段。
<script src="web/vendor/bower_components/angular-1.7.2/angular.min.js"></script>
<script src="web/vendor/bower_components/angular-1.7.2/angular-route.min.js"></script>
<link rel="stylesheet"; href="https://unpkg.com/ng-table@3.0.1/bundles/ng-table.min.css">
<script src="https://unpkg.com/ng-table@3.0.1//bundles/ng-table.min.js"></script>https://stackoverflow.com/questions/30312052
复制相似问题