mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
feat(navbarStyle): set navbar color by config/attr
This commit is contained in:
@@ -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, '');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user