diff --git a/ionic/components/icon/icon.ts b/ionic/components/icon/icon.ts index 513738315a..94c469d99d 100644 --- a/ionic/components/icon/icon.ts +++ b/ionic/components/icon/icon.ts @@ -1,4 +1,4 @@ -import {Directive, Input, ElementRef, Renderer} from 'angular2/core'; +import {Directive, ElementRef, Renderer} from 'angular2/core'; import {Config} from '../../config/config'; @@ -10,20 +10,34 @@ import {Config} from '../../config/config'; * For a full list of available icons, check out the * [Ionicons resource docs](../../../../resources/ionicons). * + * One feature of Ionicons is that when icon names are set, the actual icon + * which is rendered can change slightly depending on the mode the app is + * running from. For example, by setting the icon name of `alarm`, on iOS the + * icon will automatically apply `ios-alarm`, and on Material Design it will + * automatically apply `md-alarm`. This allow the developer to write the + * markup once, and let Ionic automatically apply the appropriate icon. + * * @usage * ```html - * + * * * - * + * * + * + * + * + * * ``` * * @property {string} [name] - Use the appropriate icon for the mode. - * @property {boolean} [isActive] - Whether or not the icon is active. Icons that are not active will use an outlined version of the icon. - * If there is not an outlined version for the particular icon, it will use the default (full) version. * @property {string} [ios] - Explicitly set the icon to use on iOS. * @property {string} [md] - Explicitly set the icon to use on Android. + * @property {boolean} [isActive] - Whether or not the icon has an "active" + * appearance. On iOS an active icon is filled in or full appearance, and an + * inactive icon on iOS will use an outlined version of the icon same icon. + * Material Design icons do not change appearance depending if they're active + * or not. The `isActive` property is largely used by the tabbar. * @see {@link /docs/v2/components#icons Icon Component Docs} * */ @@ -56,7 +70,7 @@ export class Icon { // deprecated warning console.warn(' has been renamed to '); console.warn(' requires the "name" attribute w/ a value'); - console.warn(' should now be '); + console.warn(' should now be '); } } @@ -68,7 +82,7 @@ export class Icon { * @private */ set name(val) { - if (!(/md-|ios-|-logo/.test(val))) { + if (!(/^md-|^ios-|-logo$/.test(val))) { // this does not have one of the defaults // so lets auto add in the mode prefix for them val = this.mode + '-' + val;