名称属性不起作用的ion-nav-view

时间:2016-08-25 17:05:55

标签: javascript html css ionic-framework

我有像这样的标签布局

<ion-view id="viewTickets" class=" ">
<ion-nav-bar class = "bar-positive">
    <ion-nav-back-button class = "button-clear" ng-click = "">
      <i class = "icon ion-arrow-left-c"></i>
    </ion-nav-back-button>
    <ion-nav-title ng-click="">
        Tickets
    </ion-nav-title>
</ion-nav-bar>

<ion-tabs class="tabs-striped tabs-top tabs-positive">
    <ion-tab title="Personal">
            <ion-nav-view name="viewtickets-tab"></ion-nav-view>
    </ion-tab>

    <ion-tab title="All">
    </ion-tab>
</ion-tabs>

我看到两个标签选项,然后在我的app.js .config中我有

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

.state('viewtickets', {
    url: '/viewtickets',
    templateUrl: 'templates/viewtickets.html',
    controller: 'ViewTicketsCtrl'
  })
  .state('viewtickets.viewticketstab', {
        url: '/viewticketstab',
        views: {
            'viewtickets-tab': {
                templateUrl: 'templates/viewticketstab.html',
            }
        }
  })

但是当我在“个人”标签上时,我看不到templates/viewticketstab.html'已加载,它在下方只是空白,这里是viewticketstab.html

<ion-view title="tickets tab">
     <ion-content class="padding">
        <h1>Tab 1</h1>

     </ion-content>
</ion-view>     

为什么将viewticketstab.html放入个人标签?

感谢您的帮助

1 个答案:

答案 0 :(得分:0)

而不是:

function addLength($toAdd, $added){
   $result = $toAdd;
    foreach ($result as & $row) {
        if ( array_key_exists($row['id'], $added) ) {
            $row['length'] = $added[$row['id']];
        }
    }
    var_dump($result);
    return $result;
}

试试这个:

$added