【问题标题】:ionic ion-nav-view with 3 level not working3 级的离子 ion-nav-view 不起作用
【发布时间】:2016-02-18 06:21:38
【问题描述】:

我有以下状态:

 $stateProvider

    .state('app', {
    url: '/app',
    abstract: true,
    templateUrl: 'templates/menu.html',
    controller: 'AppCtrl'
  })
.state('app.myClients', {
  url: '/myClients',
  //templateUrl: 'templates/myClients/myClients.html',
  views: {
    'menuContent': {
      templateUrl: 'templates/myClients/myClients.html',
      controller: 'clientController'
    }
  }
})
.state('app.myClients.rapida', {
  url: '/rapida',
  //templateUrl: 'templates/myClients/myClients.html',
  views: {
    'content_rapida@menuContent@app': {
      templateUrl: 'templates/myClients/partials/rapida.html',
  //    controller: 'qSearchController'
    }
  }
})

menu.html

<ion-side-menus hide-back-button="true" enable-menu-with-back-views="true" ng-controller="menuCtrl">
    <ion-nav-view name="menuContent"></ion-nav-view>
  </ion-side-menu-content>

myClients.html

<div class="div_clients" ng-controller="clientController">

  <ion-nav-view name="content_rapida"></ion-nav-view>
  <ion-nav-view name="content_lenta"></ion-nav-view>

  <div class="clientFilter">
    <h1 class="searchTitle">
      FILTROS
    </h1>

    <div class="filtereRow">
      Filtros (0)
      <div class="executeBt">
        <button class="execute" ng-click="">Ejecutar<i class="ion-ios-loop execute-icon"></i></button>
      </div>
    </div>

  </div>
</div>

rapida.html

<h1>HI guys!</h1>

这行得通

/app/myClients

这行不通

/app/myClients/rapida

【问题讨论】:

  • 你有什么错误吗?
  • @adeel_s 控制台没有错误:(
  • 我已经更新了这个问题,让它更简洁。

标签: angularjs ionic-framework angular-ui-router


【解决方案1】:

Hace 你试过 'content_rapida' 代替 'content_rapida@menuContent@app' 在状态定义?

您的视图应该已经在父视图中识别出“content_rapida”...

【讨论】:

    【解决方案2】:

    我终于做到了!

    我改变了这个

    .state('app.myClients.rapida', {
      url: '/rapida',
      //templateUrl: 'templates/myClients/myClients.html',
      views: {
        'content_rapida@menuContent@app': {
          templateUrl: 'templates/myClients/partials/rapida.html',
          controller: 'qSearchController'
        }
      }
    })
    

    到这里

    .state('app.myClients.rapida', {
      url: '/rapida',
      templateUrl: 'templates/myClients/myClients.html',
      views: {
        'content_rapida': {
          templateUrl: 'templates/myClients/partials/rapida.html',
          controller: 'qSearchController'
        }
      }
    })
    

    请注意,我必须使用两次 templateUrl。

    【讨论】:

      猜你喜欢
      • 2014-08-02
      • 1970-01-01
      • 1970-01-01
      • 2015-03-14
      • 2023-03-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多