Red Cricket Red Cricket - 3 months ago 34
Javascript Question

Module 'smart-table' is not available

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.org/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!

Answer

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

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