无法加载ngTable:'模块'ngTable'不可用!'

问题描述 投票:3回答:1

我想在我的应用程序中使用ngTable,并执行以下步骤:

1)导入ngTable css文件

2)导入ngTable.js文件

3)将'ngTable'添加到我的angular.module('app',[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.

我环顾四周但没找到任何东西。我似乎无法理解为什么这不起作用......我将不胜感激。

angularjs ngtable
1个回答
0
投票

我得到了同样的错误,直到我加载角度本身后开始加载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/[email protected]/bundles/ng-table.min.css">
<script src="https://unpkg.com/[email protected]//bundles/ng-table.min.js"></script>
© www.soinside.com 2019 - 2024. All rights reserved.