wip: android navbar color directive

This commit is contained in:
Drew Rygh
2015-10-18 11:27:11 -05:00
parent 3281d84718
commit 705d32aae2
3 changed files with 19 additions and 3 deletions

View File

@ -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();});