mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-21 21:15:24 +08:00
demos(docs): ng-if to ngIf
This commit is contained in:
@ -12,7 +12,7 @@ import {IonicView, Battery} from 'ionic/ionic';
|
||||
<ion-content padding>
|
||||
<h2>Battery</h2>
|
||||
<button primary outline (click)="doBatteryStatus()">Get Status</button>
|
||||
<div *ng-if="battery">
|
||||
<div *ngIf="battery">
|
||||
Battery charging: <b>{{battery.charging}}</b><br>
|
||||
Battery level: <b>{{battery.level * 100}}</b>%<br>
|
||||
Battery charging time: <b>{{battery.chargingTime}}</b>s<br>
|
||||
|
@ -10,7 +10,7 @@ import {IonicView, DeviceMotion} from 'ionic/ionic';
|
||||
<ion-title>Device Motion</ion-title>
|
||||
</ion-navbar>
|
||||
<ion-content padding>
|
||||
<div *ng-if="accel">{{accel.x}} {{accel.y}} {{accel.z}}</div>
|
||||
<div *ngIf="accel">{{accel.x}} {{accel.y}} {{accel.z}}</div>
|
||||
</ion-content>
|
||||
`
|
||||
})
|
||||
|
@ -12,7 +12,7 @@ import {IonicView, Device} from 'ionic/ionic';
|
||||
<ion-content padding>
|
||||
<h2>Device</h2>
|
||||
<button primary outline (click)="doDevice()">Get Device</button>
|
||||
<div *ng-if="device">
|
||||
<div *ngIf="device">
|
||||
Device name: {{device.name}}
|
||||
</div>
|
||||
</ion-content>
|
||||
|
@ -14,13 +14,13 @@ import {Geolocation} from 'ionic/ionic';
|
||||
<h2>Geolocation</h2>
|
||||
<button primary outline (click)="doGetLocation()">Get Location</button>
|
||||
<div>
|
||||
<b *ng-if="gettingLocation">Fetching location...</b>
|
||||
<b *ng-if="location">{{location.coords.latitude}}, {{location.coords.longitude}}</b>
|
||||
<b *ngIf="gettingLocation">Fetching location...</b>
|
||||
<b *ngIf="location">{{location.coords.latitude}}, {{location.coords.longitude}}</b>
|
||||
</div>
|
||||
<button primary outline (click)="doTrackLocation()">Track Location</button>
|
||||
<div>
|
||||
<b *ng-if="gettingTrackLocation">Fetching location...</b>
|
||||
<b *ng-if="trackLocation">{{trackLocation.coords.latitude}}, {{trackLocation.coords.longitude}}</b>
|
||||
<b *ngIf="gettingTrackLocation">Fetching location...</b>
|
||||
<b *ngIf="trackLocation">{{trackLocation.coords.latitude}}, {{trackLocation.coords.longitude}}</b>
|
||||
</div>
|
||||
</ion-content>
|
||||
`
|
||||
|
Reference in New Issue
Block a user