AngularJS多模块故障

时间:2017-01-18 08:29:00

标签: javascript angularjs module smart-table

我正在尝试将模块'smart-table'添加到我的模块中。我已按照网站上的说明(http://lorenzofox3.github.io/smart-table-website/)并使用bower install angular-smart-table来安装智能表。

angular.module("App", ['ngRoute','ui-leaflet'])

当我在上面的代码中添加'smart-table'时:

angular.module("App", ['ngRoute','ui-leaflet','smart-table'])

我的应用不再适用。我花了几个小时尝试不同的解决方案,包括但无法弄清楚模块为什么不能一起工作。

编辑:

这是来自我的index.html文件:

<script type="text/javascript" src="js/leaflet.js"></script>
<script type="text/javascript" src="/bower_components/angular-smart-table/dist/smart-table.js"></script>

来自我的bower.json文件:

{
  "name": "",
  "homepage": "https://github.com/auth0-samples/auth0-angularjs-sample",
  "authors": [
    ""
  ],
  "description": "",
  "main": "",
  "moduleType": [],
  "license": "MIT",
  "private": true,
  "ignore": [
    "**/.*",
    "node_modules",
    "bower_components",
    "test",
    "tests"
  ],
  "dependencies": {
    "auth0-lock": "10.2.2",
    "angular-jwt": ">= 0.1.3",
    "angular-lock": "~1.0.2",
    "a0-angular-storage": "0.0.5",
    "angular-ui-router": "~0.3.1",
    "bootstrap": "~3.3.7",
    "angular-smart-table": "2.1.8"
  },
  "resolutions": {
    "angular": "1.5.8"
  }
}

1 个答案:

答案 0 :(得分:0)

你需要做的第一件事就是包含在你的html文件中

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

然后添加到您的模块

var app = angular.module('app',['smart-table']);