首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >模块“智能表”不可用

模块“智能表”不可用
EN

Stack Overflow用户
提问于 2015-11-06 19:58:34
回答 4查看 2.9K关注 0票数 2

我正试着从一张漂亮的桌子开始。我遵循这里可用的说明:http://lorenzofox3.github.io/smart-table-website/,根据这些指令,我所需要做的就是运行,bower install angular-smart-table,然后添加模块angular.module('myApp',['smart-table']到您的角度应用程序中。这是我的角度应用:

代码语言:javascript
复制
# pwd
/var/www/html
# cat meanVoyApp.js 
var app = angular.module("meanVoyApp", ['smart-table']);

但是现在当我加载标记时,我在浏览器控制台中得到了以下错误:

代码语言:javascript
复制
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

我没有拼错,所以我想我“忘了”加载它。那我该怎么装呢?我怎么知道它是否已经装载了,还有什么问题吗?

谢谢!

EN

回答 4

Stack Overflow用户

回答已采纳

发布于 2015-11-06 20:02:54

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

代码语言:javascript
复制
<script src="[directoryOfModule]/smart-table.js"></script>
票数 5
EN

Stack Overflow用户

发布于 2015-11-06 20:04:20

智能表附带了一些js文件。我认为您之前没有将它加载到您的meanVoyApp.js加载中。使用工具网络面板来识别java-脚本是否正确加载。

在加载app.js之前使用以下代码

代码语言:javascript
复制
<script src="http://lorenzofox3.github.io/smart-table-website/bower_components/angular-smart-table/dist/smart-table.js"></script>
票数 2
EN

Stack Overflow用户

发布于 2016-05-05 03:23:57

使用

代码语言:javascript
复制
bower install angular-smart-table --save

一些良好的吞咽或咕噜的构建工具配置(例如,yeoman)将自动将其添加到您的index.html中。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/33574727

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档