mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
refactor(item): add .item-icon to child icons
This commit is contained in:
@@ -48,6 +48,13 @@ export class Icon {
|
||||
this.mode = config.get('iconMode');
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
addClass(className) {
|
||||
this._renderer.setElementClass(this._elementRef, className, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import {Component, ContentChildren} from 'angular2/core';
|
||||
|
||||
import {Button} from '../button/button';
|
||||
import {Icon} from '../icon/icon';
|
||||
|
||||
|
||||
/**
|
||||
@@ -65,4 +66,11 @@ export class Item {
|
||||
set _buttons(buttons) {
|
||||
Button.setRoles(buttons, 'item-button');
|
||||
}
|
||||
|
||||
@ContentChildren(Icon)
|
||||
set _icons(icons) {
|
||||
icons.toArray().forEach(icon => {
|
||||
icon.addClass('item-icon');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user