2017-03-24 19 views
1

私はちょうど別のページに移動したいです。 hrefは機能しません。イオンhrefが動作しない

HTMLコード:App.js

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

.state('app.top', { 
    url: '/top', 
    views: { 
    'menuContent': { 
     templateUrl: 'templates/top.html' 
    } 
    } 
}); 
}); 

<a class="item item-avatar" href="#/app/top"> 
    <img src="../img/cool.png"> 
    <h2>Cool Status <p style="float:right;"> >></p></h2> 
</a> 

私も https://forum.ionicframework.com/t/ionic-href-not-working/17750 上のフォーラムを読んでいますが、それでも私はそのいずれかの仮定してい

+0

あなたがここにあなたの例では、ルートが欠落しているかのhrefあなたは 'UIを使用する必要があります – George

+0

'#/ top'のいずれかである必要があり-sref = "app.top" ' – devqon

答えて

2

を働いていないHREFナビゲーションの形式が機能します。

HTMLコード:

<a class="item item-avatar" href="#/top"> 
    <img src="../img/cool.png"> 
    <h2>Cool Status <p style="float:right;"> >></p></h2> 
</a> 

App.js

.config(function($stateProvider, $urlRouterProvider) { 
    $stateProvider 
     .state('top', { 
      url: '/top', 
      templateUrl: 'templates/top.html' 
     }); 

    $urlRouterProvider.otherwise("/"); 
}); 
関連する問題