mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 12:29:55 +08:00
demos(docs): ng-if to ngIf
This commit is contained in:
@ -7,7 +7,7 @@
|
||||
|
||||
<button (click)="showBlur=true" primary>Blur</button>
|
||||
|
||||
<div ion-blur (click)="showBlur=false" *ng-if="showBlur" style="display: flex; justify-content: center; align-items: center; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(255,255,255,0.8);">
|
||||
<div ion-blur (click)="showBlur=false" *ngIf="showBlur" style="display: flex; justify-content: center; align-items: center; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(255,255,255,0.8);">
|
||||
<h2>Blurred!</h2>
|
||||
</div>
|
||||
</ion-content>
|
||||
|
@ -3,8 +3,8 @@
|
||||
Description
|
||||
</ion-title>
|
||||
<ion-buttons start>
|
||||
<button (click)="dismiss()" *ngIf=" currentPlatform === 'ios' ">
|
||||
Cancel
|
||||
<button (click)="dismiss()" clear *ngIf=" currentPlatform === 'ios' ">
|
||||
<span primary>Cancel</span>
|
||||
</button>
|
||||
<button (click)="dismiss()" *ngIf=" currentPlatform === 'android' ">
|
||||
<ion-icon name='close'></ion-icon>
|
||||
|
@ -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