admin管理员组

文章数量:1333211

I am trying to get started with a smart-table. I am following the instructions available here: / So according to those instructions all I need to do is run, bower install angular-smart-table and then add then add the module angular.module('myApp',['smart-table'] to your angular application. Here's my angular application:

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

But now when I load my markup I get these errors in my browsers console:

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.
.3.14/$injector/nomod?p0=smart-table

I didn't misspell so I guess I "forgot" to load it. So how do I load it? How can I tell if it is already loaded and something else is the problem?

Thanks!

I am trying to get started with a smart-table. I am following the instructions available here: http://lorenzofox3.github.io/smart-table-website/ So according to those instructions all I need to do is run, bower install angular-smart-table and then add then add the module angular.module('myApp',['smart-table'] to your angular application. Here's my angular application:

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

But now when I load my markup I get these errors in my browsers console:

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/1.3.14/$injector/nomod?p0=smart-table

I didn't misspell so I guess I "forgot" to load it. So how do I load it? How can I tell if it is already loaded and something else is the problem?

Thanks!

Share Improve this question asked Nov 6, 2015 at 19:58 Red CricketRed Cricket 10.5k23 gold badges92 silver badges187 bronze badges
Add a ment  | 

4 Answers 4

Reset to default 5

Did you remember to add a reference to the script in your index.html?

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

Smart-table es with some js file. I think you are not loading that before to your meanVoyApp.js load. Use chrome developer tool network panel to identify the java-script are properly loaded nor not.

Use the following code before your app.js load

<script src="http://lorenzofox3.github.io/smart-table-website/bower_ponents/angular-smart-table/dist/smart-table.js"></script>

Use

bower install angular-smart-table --save

and some good gulp or grunt build tool configuration (e.g. yeoman) will automatically add it to your index.html.

Take a look at your build process.

In case you use ngBoilerplate kickstarter, you need to add the following line: 'vendor/angular-smart-table/dist/smart-table.min.js'

inside vendor_files section of build.config.js file.

本文标签: javascriptModule 39smarttable39 is not availableStack Overflow