jeudi 19 février 2015

AngularJS: ng-view is not replaced, when i open with a sub url in chrome's address bar


I found that the content of ng-view isn't replaced when i request a sub url of my app directly in Chrome's address bar. but if i request the url from a tag, then it works perfectly.


i also checked the log, but it shows nothing...


e.g. Here is a module of my app which defines the router '/search'



(function () {
'use strict';
angular
.module('search',[])
.config(['$routeProvider', function($routeProvider) {
$routeProvider.when('/search', {
templateUrl: 'search/search.html',
controller: 'Search',
controllerAs: 'vm'
});
}]);
})();


if i direct request /search in my browser's address bar, the ng-view is totally empty, but if i request /search from a tag, it works.





Aucun commentaire:

Enregistrer un commentaire