angularjs - Angular error, in npm build [$injector:nomod] Module 'testApp' is not available -
studying , practicing npm build, im trying compile script using npm run build , got error
[$injector:nomod] module 'testapp' not available! either misspelled module name or forgot load it. if registering module ensure specify dependencies second argument.
any advice.
app.js import angular 'angular'; import 'angular-ui-router'; import './services/router.js'; angular.module('testapp', [ 'ui-router' ]); ----------------------------- roter.js 'use strict'; angular .module('testapp') .config([ '$urlrouterprovider', '$stateprovider', '$locationprovider', function($urlrouterprovider, $stateprovider, $locationprovider) { $locationprovider.html5mode(false).hashprefix(''); $urlrouterprovider.otherwise('/'); $stateprovider .state('home', { url: '/', templateurl: 'components/views/homepage.html', controller: 'productcontroller' }) .state('about', { url: '/about', templateurl: 'components/views/about.html' }) .state('product', { url: '/product/:id/:name', templateurl: 'components/views/product.html', controller: 'productviewcontroller' }) }]);
change
from
angular.module('testapp', [ 'ui-router' ]);
to
angular.module('testapp', [ 'ui.router' ]);
Comments
Post a Comment