javascript - 模块 'smart-table' 不可用

标签 javascript angularjs smart-table

我正在尝试开始使用智能表。我正在按照此处提供的说明进行操作:http://lorenzofox3.github.io/smart-table-website/ 因此,根据这些说明,我需要做的就是运行 bower install angular-smart-table 然后添加模块 angular.module('myApp',['smart-table '] 到你的 Angular 应用程序。这是我的 Angular 应用程序:

# pwd
/var/www/html
# cat meanVoyApp.js 
var app = angular.module("meanVoyApp", ['smart-table']);

但是现在当我加载我的标记时,我在我的浏览器控制台中收到这些错误:

Uncaught Error: [$injector:modulerr] Failed to instantiate module meanVoyApp due to:
Error: [$injector:modulerr] Failed to instantiate module smart-table due to:
Error: [$injector:nomod] Module 'smart-table' 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.
http://errors.angularjs.org/1.3.14/$injector/nomod?p0=smart-table

我没有拼错,所以我想我“忘记”加载它了。那么我该如何加载呢?我如何判断它是否已加载以及其他问题?

谢谢!

最佳答案

您是否记得在 index.html 中添加对脚本的引用?

<script src="[directoryOfModule]/smart-table.js"></script>

关于javascript - 模块 'smart-table' 不可用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33574727/

相关文章:

javascript - 如何使按钮在 AngularJS 的智能表格的第一页和最后一页上跳过

AngularJS 智能表严格搜索

javascript onmousemove 获取相对坐标

javascript - 在 Javascript 中使用回调处理变量赋值?

javascript - 在 JS 中,获取 SVG 路径的实际(计算)笔划宽度

javascript - 在 Karma/Jasmine 测试中模拟 Enter 键按下输入

javascript - 即使模型已预先初始化,AngularJs 也不会更新 html 中的选择

javascript - 将逗号分隔的字符串转换为数组

angularjs - 当 $q.all 在 Angularjs 中有多个 http 调用函数时,是否有任何方法排序?

angularjs - Smart-table - 从代码设置页面