çalışmıyor. Şimdi
page1.ts
import { Component, trigger, state, style, transition, animate } from '@angular/core';
import { NavController } from 'ionic-angular';
@Component({
selector: 'page-page1',
templateUrl: 'page1.html',
animations: [
trigger('buttonState', [
state('left', style({ transform: 'translateX(100px)', backgroundColor: 'red' })),
state('right', style({ transform: 'translateX(0)', backgroundColor: 'blue' })),
transition('left <=> right', [
animate('1000ms ease-in-out')
])
])
]
})
export class Page1 {
state: string = 'left';
constructor(public navCtrl: NavController) {
}
changeState() {
this.state = this.state == 'left' ? 'right': 'left';
}
}
<ion-header>
<ion-navbar>
<button ion-button menuToggle>
<ion-icon name="menu"></ion-icon>
</button>
<ion-title>Page One</ion-title>
</ion-navbar>
</ion-header>
<ion-content padding>
<h3>Ionic Menu Starter</h3>
<p>
If you get lost, the <a href="http://ionicframework.com/docs/v2">docs</a> will show you the way.
</p>
<button ion-button secondary [@buttonState]="state" (click)="changeState()">Toggle Menu</button>
</ion-content>
page1.html
iOS'ta değil, Android cihazlarda çalışır. Sadece yerleşik animasyonları Angular ile kullanmak istiyorum. Bununla ilgili her türlü düşünceyi her iki platformda nasıl çalıştırabilirim?