Red Cricket Red Cricket - 1 year ago 210
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:
So according to those instructions all I need to do is run,

bower install angular-smart-table
and then add then add the module
to your angular application. Here's my angular application:

# pwd
# 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.$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?


Answer Source

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

<script src="[directoryOfModule]/smart-table.js"></script>
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download