2016-05-28 7 views
0

Ich versuche, unter Verwendung von Ionengehalt als:Ionic2 Ionengehalt macht nicht Inhalt

<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> 

Und mache nicht Inhalt:

enter image description here

Wenn den Ionengehalt Tag entfernt der Inhalt angezeigt wird , aber nicht enthalten scrollen

enter image description here

Antwort

1

Ich fand das Problem, ich verwendete in der Steuerung der Klasse für Ansicht (mit Ionen-Inhalt) @Component anstelle von @Page. Nach Änderung für @Page funktioniert für mich.

Vor

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' 
}) 

Nach

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' 
})