UI 라우터의 다중보기 기능을 사용하여 SPA를 만들려고하지만 내 섹션이 페이지에 표시되지 않는 이유를 파악할 수 없습니다.UI-Router 및 generator-angular를 사용하여 SPA 용 섹션을 사용하는 다중보기
여기 내 응용 프로그램 설정입니다 :
angular
.module('myApp', [
'ngAnimate',
'ngCookies',
'ngResource',
'ngRoute',
'ui-router'
'ngSanitize',
'ngTouch'
])
.config(function($stateProvider, $urlRouterProvider, $locationProvider) {
$urlRouterProvider.otherwise('/main');
$stateProvider
.state('/', {
url: 'main',
views: {
'v1': {
templateUrl: 'views/v1.html',
controller: 'V1Ctrl'
},
'v2': {
templateUrl: 'views/v2.html',
controller: 'V2Ctrl'
},
'v3': {
templateUrl: 'views/v3.html',
controller: 'V3Ctrl'
},
'v4': {
templateUrl: 'views/V4.html',
controller: 'V4Ctrl'
},
'v5': {
templateUrl: 'views/v5.html',
controller: 'V5Ctrl'
},
'V6': {
templateUrl: 'views/V6.html',
controller: 'V6Ctrl'
}
}
});
$locationProvider.html5Mode(true);
});
그리고 내 main.html에 :
<section ui-view="v1" id="v1"></section>
<section ui-view="v2" id="v2 ></section>
<section ui-view="v3" id="v3" ></section>
<section ui-view="v4" id="v4" ></section>
<section ui-view="v5" id="v5" ></section>
<section id="v6" ui-view="v6" ></section>
나는 일 동안이 문제에 붙어 봤는데 설명을 찾을 수 없습니다.
TrazeK를 수정했습니다. 오류 : [$ injector : 모듈러] 상태 '주'가 이미 정의되었습니다 ... – shklsw
여기에 내가 현재 갖고있는 [PLunker] (http : // plnkr.co/edit/OsRs2PxgoUPxUR246nwQ?p=preview/ "Plunker") – shklsw
Plunker에서 'ng-app = "myApp"를' 및
' 당신은 오직 하나만 필요로하고 나는 태그 안에있는 것을 개인적으로 사용할 것입니다. (에있는 것을 제거하십시오). 또한 각보기에 대한 컨트롤러가 정의되어 있는지 확인하십시오. – TrazeK