angularjs - When changing states browser doesn't find project js files -


i trying create new state in angular using ngrouter. have index.route.js file contains following:

(function() { 'use strict';   angular .module('testapp') .config(routeconfig);  /** @nginject */ function routeconfig($stateprovider, $urlrouterprovider) {     $stateprovider       .state('home', {         url: '/',         templateurl: 'app/main/main.html',         controller: 'mainctrl'       })       .state('tools', {         url: '/tools/:category',         templateurl: 'app/tools/tools.html',         controller: 'toolsctrl',         controlleras: 'tsctrl'       });  $urlrouterprovider.otherwise('/');  } })(); 

then, have created tools.html , tools.controller.html.

tools.html:

hello world

tools.controller.js:

(function(){ 'use strict';  angular .module('testapp') .controller('toolsctrl', toolscontroller);  /** @nginject */ function toolscontroller(){     var ctrl = this;     ctrl.tools = {};     //tbd: more code. } })(); 

the problem whenever go example http://localhost:3000/tools/maps, browser complains can't find of js files suppose linked project. now, link shows contains state, example instead of searching bootstrap in http://localhost:3000/app/index.route.js searches in http://localhost:3000/tools/app/index.route.js. why that?

i have used yeoman gulp-angular generator in order create project.


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -