mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 19:21:34 +08:00
docs(demos): set tabbar color dynamically
This commit is contained in:
@ -18,7 +18,10 @@ import * as tabs from './tabs/tabs';
|
|||||||
|
|
||||||
|
|
||||||
@Directive({
|
@Directive({
|
||||||
selector: '.android-attr',
|
selector: '[android-attr]',
|
||||||
|
defaultInputs: {
|
||||||
|
'androidAttr': 'primary'
|
||||||
|
},
|
||||||
})
|
})
|
||||||
export class AndroidAttribute {
|
export class AndroidAttribute {
|
||||||
|
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
import {NavController, NavParams} from 'ionic/ionic';
|
import {NavController, NavParams} from 'ionic/ionic';
|
||||||
import {Page, ViewController} from 'ionic/ionic';
|
import {Page, ViewController, Platform} from 'ionic/ionic';
|
||||||
import {forwardRef} from 'angular2/angular2';
|
import {forwardRef} from 'angular2/angular2';
|
||||||
import * as helpers from '../../helpers';
|
import * as helpers from '../../helpers';
|
||||||
|
|
||||||
|
|
||||||
@Page({
|
@Page({
|
||||||
template: '' +
|
template: '' +
|
||||||
'<ion-navbar *navbar hide-back-button class="android-attr">' +
|
'<ion-navbar *navbar hide-back-button [attr.primary]="isAndroid ? \'\' : null">' +
|
||||||
'<ion-title>Tabs</ion-title>' +
|
'<ion-title>Tabs</ion-title>' +
|
||||||
'</ion-navbar>' +
|
'</ion-navbar>' +
|
||||||
'<ion-content>' +
|
'<ion-content>' +
|
||||||
@ -14,7 +14,9 @@ import * as helpers from '../../helpers';
|
|||||||
directives: [forwardRef(() => helpers.AndroidAttribute)],
|
directives: [forwardRef(() => helpers.AndroidAttribute)],
|
||||||
})
|
})
|
||||||
class TabTextPage {
|
class TabTextPage {
|
||||||
constructor() {
|
constructor(platform: Platform) {
|
||||||
|
this.platform = platform;
|
||||||
|
this.isAndroid = platform.is('android');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
import {NavController, NavParams} from 'ionic/ionic';
|
import {NavController, NavParams} from 'ionic/ionic';
|
||||||
import {Page, ViewController} from 'ionic/ionic';
|
import {Page, ViewController, Platform} from 'ionic/ionic';
|
||||||
import {forwardRef} from 'angular2/angular2';
|
import {forwardRef} from 'angular2/angular2';
|
||||||
import * as helpers from '../../helpers';
|
import * as helpers from '../../helpers';
|
||||||
|
|
||||||
|
|
||||||
@Page({
|
@Page({
|
||||||
template: '' +
|
template: '' +
|
||||||
'<ion-navbar *navbar hide-back-button class="android-attr">' +
|
'<ion-navbar *navbar hide-back-button [attr.royal]="isAndroid ? \'\' : null">' +
|
||||||
'<ion-title>Tabs</ion-title>' +
|
'<ion-title>Tabs</ion-title>' +
|
||||||
'</ion-navbar>' +
|
'</ion-navbar>' +
|
||||||
'<ion-content>' +
|
'<ion-content>' +
|
||||||
@ -14,7 +14,9 @@ import * as helpers from '../../helpers';
|
|||||||
directives: [forwardRef(() => helpers.AndroidAttribute)],
|
directives: [forwardRef(() => helpers.AndroidAttribute)],
|
||||||
})
|
})
|
||||||
class TabIconTextPage {
|
class TabIconTextPage {
|
||||||
constructor() {
|
constructor(platform: Platform) {
|
||||||
|
this.platform = platform;
|
||||||
|
this.isAndroid = platform.is('android');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
import {NavController, NavParams} from 'ionic/ionic';
|
import {NavController, NavParams} from 'ionic/ionic';
|
||||||
import {Page, ViewController} from 'ionic/ionic';
|
import {Page, ViewController, Platform} from 'ionic/ionic';
|
||||||
import {forwardRef} from 'angular2/angular2';
|
import {forwardRef} from 'angular2/angular2';
|
||||||
import * as helpers from '../../helpers';
|
import * as helpers from '../../helpers';
|
||||||
|
|
||||||
|
|
||||||
@Page({
|
@Page({
|
||||||
template: '' +
|
template: '' +
|
||||||
'<ion-navbar *navbar hide-back-button class="android-attr">' +
|
'<ion-navbar *navbar hide-back-button [attr.danger]="isAndroid ? \'\' : null">' +
|
||||||
'<ion-title>Tabs</ion-title>' +
|
'<ion-title>Tabs</ion-title>' +
|
||||||
'</ion-navbar>' +
|
'</ion-navbar>' +
|
||||||
'<ion-content>' +
|
'<ion-content>' +
|
||||||
@ -14,7 +14,9 @@ import * as helpers from '../../helpers';
|
|||||||
directives: [forwardRef(() => helpers.AndroidAttribute)],
|
directives: [forwardRef(() => helpers.AndroidAttribute)],
|
||||||
})
|
})
|
||||||
class TabIconPage {
|
class TabIconPage {
|
||||||
constructor() {
|
constructor(platform: Platform) {
|
||||||
|
this.platform = platform;
|
||||||
|
this.isAndroid = platform.is('android');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user