2016-04-30 24 views
0

イオニックサイドメニューの既定のアプリケーションが作成され、マップとマーカーの追加がメニューリストに追加されました。マップはうまくいきますが、MarkerClickはそうではありません。 MarkerClickフォームのsidemenuをクリックすると、最後のアクティブページでリダイレクトされます。イオニックページナビゲーションが機能しない

<ion-side-menu side="left"> 
    <ion-header-bar class="bar-stable"> 
     <h1 class="title">Left</h1> 
    </ion-header-bar> 
    <ion-content> 
     <ion-list> 
      <ion-item menu-close ng-click="login()"> 
       Login 
      </ion-item> 
      <ion-item menu-close href="#/app/search"> 
       Search 
      </ion-item> 
      <ion-item menu-close href="#/app/browse"> 
       Browse 
      </ion-item> 
      <ion-item menu-close href="#/app/playlists"> 
       Playlists 
      </ion-item> 
      <ion-item menu-close href="#/app/map"> 
       Map 
      </ion-item> 
      <ion-item menu-close href="#/app/markerClick"> 
       Marker 
      </ion-item> 
     </ion-list> 
    </ion-content> 
</ion-side-menu> 

app.js

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

    .state('app', { 
     url: '/app', 
     abstract: true, 
     templateUrl: 'templates/menu.html', 
     controller: 'AppCtrl' 
    }) 
    .state('app.search', { 
     url: '/search', 
     views: { 
      'menuContent': { 
       templateUrl: 'templates/search.html' 
      } 
     } 
    }) 
    .state('app.browse', { 
     url: '/browse', 
     views: { 
      'menuContent': { 
       templateUrl: 'templates/browse.html' 
      } 
     } 
    }) 
    .state('app.playlists', { 
     url: '/playlists', 
     views: { 
      'menuContent': { 
       templateUrl: 'templates/playlists.html', 
       controller: 'PlaylistsCtrl' 
      } 
     } 
    }) 
    .state('app.single', { 
     url: '/playlists/:playlistId', 
     views: { 
      'menuContent': { 
       templateUrl: 'templates/playlist.html', 
       controller: 'PlaylistCtrl' 
      } 
     } 
    }) 
    .state('app.map', { 
     url: '/map', 
     views: { 
      'menuContent': { 
       templateUrl: 'templates/map.html', 
       controller: 'MapCtrl' 
      } 
     } 
    }) 
    .state('app.markerClick', { 
     url: '/markerClick', 
     view: { 
      'menuContent': { 
       //templateUrl: '<h1>what the hello</h1>', 
       templateUrl: 'templates/testTemplate.html', 
       controller: 'markerClickCtr' 
      } 
     } 
    }); 
// if none of the above states are matched, use this as the fallback 
$urlRouterProvider.otherwise('/app/map'); 
}); 

enter image description here

enter image description here

答えて

0

menu.htmlは、UI-SREF = "app.markerClick" UIでのhrefを交換してください-Routerは、リンクすることができるui-srefを提供します状態に。これは、通常のURLへのリンクとは異なります。 UI-Routerを使用する場合は、URLではなく状態にリンクします。

+0

ありがとうございました。今すぐ働いて – Souras

+0

それに応じて答えを記入してください –

関連する問題