javascript - angularjs ui.router is throwing Error: Unexpected request: GET -
i trying implement angularjs routing using ui-router. have index.html file trying load partial productlistview.html using app.js javascript seeing error: unexpected request: productlistview.html in console. appreciated.
index.html:
<!doctype html> <html> <head lang="en"> <meta charset="utf-8"> <title>acme product management</title> <!--style sheets--> <link rel="stylesheet" type="text/css" href="styles/app.css"> <link rel="stylesheet" type="text/css" href="styles/bootstrap.css"> </head> <body ng-app="productmanagement"> <div class="container"> <div ui-view></div> </div> <!--library scripts--> <script src="js/angular.min.js"></script> <script src="js/angular-mocks.js"></script> <script src="js/angular-resource.min.js"></script> <script src="js/angular-ui-router.min.js"></script> <!--application script--> <script src="app.js"></script> <!--services--> <script src="common/services/common-services.js"></script> <script src="common/services/productresource.js"></script> <script src="common/services/productresourcemock.js"></script> <!--product controllers--> <script src="products/productlistctrl.js"></script> </body> </html> app.js:
(function(){ 'use strict'; angular.module('productmanagement',['common-services', 'productresourcemock', 'ui.router']) .config(['$stateprovider', '$urlrouterprovider', function($stateprovider, $urlrouterprovider){ $urlrouterprovider.otherwise('/products'); $stateprovider .state('productlist', { url: '/products', templateurl: 'products/productlistview.html', controller: 'productlistctrl' }); }] ); })(); 
i think, must change: $httpbackend.whenget(/app/).passthrough(); in productresourcemock.js file
Comments
Post a Comment