While working on my angularjs application, I encountered an issue with ngtable during the grunt build process. It seems that the references are missing, resulting in the following error:
Uncaught Error: [$injector:modulerr] Failed to instantiate module parts360App due to:
Error: [$injector:modulerr] Failed to instantiate module ngTable due to:
Error: [$injector:nomod] Module 'ngTable' 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.6.4/$injector/nomod?p0=ngTable
at http://localhost:9000/bower_components/angular/angular.js:66:12
The table library I am using can be found here -
bower install ng-table --save
Although bower.json gets updated, the reference for the table is unavailable in the index.html file.
I also attempted using npm, but encountered an error in the command prompt:
+-- UNMET PEER DEPENDENCY angular@^1.2
`-- <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="e18f86cc9580838d84a1d2cFd1cfd0">[email protected]</a>
npm WARN <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="86e8e1abf2e7e4eae3c6b5a8b6a8b7">[email protected]</a> requires a peer of angular@^1.2 but none was installed.
This is a snippet of my bower.json file:
{
"name": "parts360",
"version": "0.0.0",
"dependencies": {
"angular": "^1.4.0",
"bootstrap": "^3.2.0",
"angular-resource": "^1.4.0",
"angular-route": "^1.4.0",
"angular-bootstrap": "^2.5.0",
"angular-busy": "^4.1.4",
"ng-table": "^3.0.1"
},
"devDependencies": {
"angular-mocks": "^1.4.0"
},
"appPath": "app",
"moduleName": "parts360App",
"overrides": {
"bootstrap": {
"main": [
"less/bootstrap.less",
"dist/css/bootstrap.css",
"dist/js/bootstrap.js"
]
}
}
}
If anyone has suggestions on how to resolve this and include the necessary references in index.html, please share your insights.
An example of including references in index.html from others:
<!-- build:js(.) scripts/vendor.js -->
<!-- bower:js -->
<script src="bower_components/jquery/dist/jquery.js"></script>
<script src="bower_components/angular/angular.js"></script>
<script src="bower_components/bootstrap/dist/js/bootstrap.js"></script>
<script src="bower_components/angular-resource/angular-resource.js"></script>
<script src="bower_components/angular-route/angular-route.js"></script>
<script src="bower_components/angular-bootstrap/ui-bootstrap-tpls.js"></script>
<script src="bower_components/angular-animate/angular-animate.js"></script>
<script src="bower_components/angular-busy/dist/angular-busy.js"></script>
<!-- endbower -->
<!-- endbuild -->
<!-- build:js({.tmp,app}) scripts/scripts.js -->