我正试着从一张漂亮的桌子开始。我遵循这里可用的说明:http://lorenzofox3.github.io/smart-table-website/,根据这些指令,我所需要做的就是运行,bower install angular-smart-table,然后添加模块angular.module('myApp',['smart-table']到您的角度应用程序中。这是我的角度应用:
# 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我没有拼错,所以我想我“忘了”加载它。那我该怎么装呢?我怎么知道它是否已经装载了,还有什么问题吗?
谢谢!
发布于 2015-11-06 20:02:54
您记得在index.html中添加对脚本的引用吗?
<script src="[directoryOfModule]/smart-table.js"></script>发布于 2015-11-06 20:04:20
智能表附带了一些js文件。我认为您之前没有将它加载到您的meanVoyApp.js加载中。使用工具网络面板来识别java-脚本是否正确加载。
在加载app.js之前使用以下代码
<script src="http://lorenzofox3.github.io/smart-table-website/bower_components/angular-smart-table/dist/smart-table.js"></script>发布于 2016-05-05 03:23:57
使用
bower install angular-smart-table --save一些良好的吞咽或咕噜的构建工具配置(例如,yeoman)将自动将其添加到您的index.html中。
https://stackoverflow.com/questions/33574727
复制相似问题