feat(navbarStyle): set navbar color by config/attr

This commit is contained in:
Adam Bradley
2015-11-05 22:51:30 -06:00
parent 246fd977f2
commit f04181d468
3 changed files with 30 additions and 15 deletions

View File

@@ -1,4 +1,4 @@
import {AppViewManager, ElementRef, Directive} from 'angular2/angular2';
import {AppViewManager, ElementRef, Directive, Renderer} from 'angular2/angular2';
import {IonicApp} from './app';
@@ -47,3 +47,15 @@ export class IdRef {
this.app.unregister(this.id);
}
}
@Directive({
selector: '[attr]',
inputs: ['attr']
})
export class Attr {
constructor(private renderer: Renderer, private elementRef: ElementRef) {}
onInit() {
this.renderer.setElementAttribute(this.elementRef, this.attr, '');
}
}