2016-05-28 84 views
0

我嘗試使用離子含量爲:Ionic2離子含量不呈現內容

<ion-content> 
    <ion-list> 
     <button ion-item *ngFor="let item of items" (click)="itemTapped($event, item)" class="list-item"> 
      <img class="picture" src="/build/images/profile/{{item.picture}}" item-left/> 
      <div class="item-data"> 
       <div> 
        <span class="title">{{item.title}}</span> 
        <span class="sub-title">{{item.typeWork}}</span> 
        <span class="distance"><ion-icon name="map" item-right></ion-icon>{{item.distance}} km</span> 
       </div> 
       <div class="evaluation"> 
        <span><ion-icon name="cash"></ion-icon>{{item.noteAveragePrice}}</span> 
        <span><ion-icon name="ribbon"></ion-icon>{{item.noteAverageService}}</span> 
        <span><ion-icon name="clock"></ion-icon>{{item.noteAverageScore}}</span> 
       </div> 
      </div> 
      <!-- 
      <span class="description">{{item.description}}</span> 
      --> 
     </button> 
    </ion-list> 
    <div *ngIf="selectedItem" padding> 
     You navigated here from <b>{{selectedItem.title}}</b> 
    </div> 
</ion-content> 

而不是呈現內容:

enter image description here

當去除離子含量標籤顯示的內容,但不包含滾動

enter image description here

回答

1

我發現了這個問題,我用在視圖控制器中(用離子內容)@組件而不是@頁。更改爲@頁適用於我。

之前

import {Component, ViewChild} from '@angular/core'; 
import {NavController, Alert, Content} from 'ionic-angular'; 
import {ProfessionalModel} from './professional-model'; 

@Component({ 
    templateUrl: 'build/pages/professional/professional-view.html' 
}) 

import {ViewChild} from '@angular/core'; 
import {NavController, Alert, Content, Page} from 'ionic-angular'; 
import {ProfessionalModel} from './professional-model'; 

@Page({ 
    templateUrl: 'build/pages/professional/professional-view.html' 
})