2016-12-02 1 views
0

하나의 .html 파일에 3 페이지 콘텐츠를 넣으려고하는데 그럴 생각이 없습니다.이오닉 컨트롤 페이지

<script id="templates/topList.html" type="text/ng-template"> 
     <ion-view> 
     <ion-content class="padding"> 
      <p> 
      <a class="button icon icon-right ion-chevron-right" href="#/tab/facts">Scientific Facts</a> 
      </p> 
     </ion-content> 
     </ion-view> 

    </script> 

    <script id="templates/topList2.html" type="text/ng-template"> 
     <ion-view> 
     <ion-content class="padding"> 
      <p> 
      <a class="button icon icon-right ion-chevron-right" href="#/tab/facts">Scientific Facts</a> 
      </p> 
     </ion-content> 
     </ion-view> 

    </script> 

그리고 내 app.js는 이것이다 : 내이 .html 페이지 코드는 여기

.config(function($stateProvider, $urlRouterProvider) { 
    $stateProvider 

    .state('home', { 
    url: '/', 
    templateUrl: 'templates/home.html' 
    }) 
    .state('registration', { 
    url: '/registration', 
    templateUrl: 'templates/registration.html', 
    controller: 'RegistrationCtrl' 
    }) 
    .state('code_entery_page', { 
    url: '/code_entery_page', 
    templateUrl: 'templates/code_entery_page.html', 
    controller: 'code_entery_pageCtrl' 
    }) 
    .state('registration-create-profile', { 
    url: '/registration-create-profile', 
    templateUrl: 'templates/registration-create-profile.html', 
    controller: 'registration-create-profileCtrl' 
    }) 
    .state('app.main-traveler-page', { 
    url: '/main-traveler-page', 
    templateUrl: 'templates/main-traveler-page.html', 
    controller: 'main-traveler-pageCtrl' 
    }) 

    .state('pinko.main-pinko-page', { 
    url: '/main-pinko-page', 
    templateUrl: 'templates/main-pinko-page.html', 
    controller: 'main-pinko-pageCtrl' 
    }) 



    .state('app', { 
    url: '/app', 
    abstract: true, 
    templateUrl: 'templates/directives/traveler-navigation.html', 
    controller: 'AppCtrl' 
    }) 

    .state('pinko', { 
    url: '/pinko', 
    abstract: true, 
    templateUrl: 'templates/directives/pinko-navigation.html', 
    controller: 'AppCtrl' 
    }) 




    $urlRouterProvider.otherwise('/'); 
}); 

하지만 난 toplist.html과 app.js에 toplist2.html에 연결하는 방법을 잘 모릅니다 내 페이지가 열려있을 때 작동합니까? 에서 app.js - .state ('pinko.main-pinko-page')는 내가 toplist.html과 toplist2.html을 보여주고 싶은 페이지입니다.

답변

0

공통 템플릿과 같은 단일 html 파일에 두 템플릿을 모두 추가하십시오 .html.

그리고이 공통 템플릿을 .state ('pinko.main-pinko-page')에서 질문 한 것처럼 main-pinko-page.html에 포함하십시오.

위의 경우를 한 곳에서만 사용해야하는 경우 그렇지 않으면 모든 탐색이 시작되는 기본 HTML 파일에이 공통 템플릿을 포함하십시오.

+0

몇 가지 예가 무엇입니까? 포함 할 곳을 따라 가지 않으시겠습니까? –

+0

언제 추가 하시겠습니까? 특정 일정이나 다른 일정이 있습니까? –

+0

main-pinko-page.html 페이지에 세 가지 유형의 콘텐츠를 추가하고 싶습니다. 나는 main-pinko-page.html 세 개의 추천을 가진 상단 탐색에 있습니다. 예 탐색 (집/정보/연락처). 예를 들어 집에서의 클릭에 대해 에있는 콘텐츠를 표시하고 싶습니다. –