응용 프로그램에 각도 UI 라우터를 사용하려고합니다. 말하지 않고 UI 라우터를 초기화 할 때 localhost:8000/#/
이 localhost:8000/#!#%2F
이됩니다. ! 내 quiz.routes.js에서각도 UI 라우터 초기화 중
angular
.module('quiz',['ngMaterial',
'ngMessages',
'ngCookies',
'ngResource',
'quiz.routes'
]).config(function($resourceProvider) {
$resourceProvider.defaults.stripTrailingSlashes = false;
});
angular
.module('quiz.routes',['ui.router']);
를 내가 가지고 : 다음과 같이
내 app.js
이다에서 # %의 2 층(function() {
angular
.module('quiz.routes')
.config(config);
function config($urlRouterProvider,$stateProvider){
$stateProvider
.state('register',{
url: '',
templateUrl: '/static/templates/register.html'
});
}
})();
그래서 대신 내가 할 후행 슬래시를 내 URL. 왜 이런거야?
주 모듈에 quize.routes를 주입 했습니까? – Sajeetharan
예, 코드를 편집하고 여기에 추가하는 것을 잊었습니다 –
글쎄, 이에 대한 답을 쓸만큼 확실하지 않습니다. 하지만 당신의 경우에는 URL을 설정해야한다고 생각합니다. '/'... 추상 상태를 정의하는 경우 빈 URL 만 가질 수 있습니다. – Canastro