mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 11:41:20 +08:00
wip: android navbar color directive
This commit is contained in:
@ -1,3 +1,7 @@
|
||||
import {Directive, ElementRef, Renderer} from 'angular2/angular2';
|
||||
import {Platform, Navbar} from 'ionic/ionic';
|
||||
|
||||
|
||||
import {ActionSheetPage} from './actionSheet/actionSheet';
|
||||
|
||||
import {ButtonsPage,
|
||||
@ -30,6 +34,17 @@ import {PopupsPage} from './popups/popups';
|
||||
import {SlidesPage} from './slides/slides';
|
||||
import {TabsPage} from './tabs/tabs';
|
||||
|
||||
@Directive({
|
||||
selector: '.android-attr',
|
||||
})
|
||||
export class AndroidAttribute {
|
||||
|
||||
constructor (platform: Platform, elementRef: ElementRef, renderer: Renderer) {
|
||||
this.isAndroid = platform.is('android');
|
||||
renderer.setElementAttribute(elementRef, 'primary', this.isAndroid ? true : null);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export function toTitleCase(str) {
|
||||
return str.replace(/\w\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();});
|
||||
|
Reference in New Issue
Block a user