diff --git a/ionic/components/tabs/tab.ts b/ionic/components/tabs/tab.ts index af5ce90c35..67c3cba1f0 100644 --- a/ionic/components/tabs/tab.ts +++ b/ionic/components/tabs/tab.ts @@ -79,6 +79,8 @@ import {TabButton} from './tab-button'; * @property {any} [root] - set the root page for this tab * @property {any} [tabTitle] - set the title of this tab * @property {any} [tabIcon] - set the icon for this tab + * @property {any} [tabBadge] - set the badge for this tab + * @property {any} [tabBadgeStyle] - set the badge color for this tab * @property {any} [select] - method to call when the current tab is selected * */ @@ -104,6 +106,7 @@ export class Tab extends NavController { @Input() tabTitle: string; @Input() tabIcon: string; @Input() tabBadge: string; + @Input() tabBadgeStyle: string; @Output() select: EventEmitter = new EventEmitter(); constructor( @@ -130,6 +133,8 @@ export class Tab extends NavController { * @private */ ngOnInit() { + this.tabBadgeStyle = this.tabBadgeStyle ? this.tabBadgeStyle : 'default'; + if (this._isInitial) { this.parent.select(this); diff --git a/ionic/components/tabs/tabs.ts b/ionic/components/tabs/tabs.ts index c54cf8957c..8c5b6e38b1 100644 --- a/ionic/components/tabs/tabs.ts +++ b/ionic/components/tabs/tabs.ts @@ -48,7 +48,7 @@ import {isUndefined} from '../../util/util'; '' + '' + '{{t.tabTitle}}' + - '{{t.tabBadge}}' + + '{{t.tabBadge}}' + '' + '' + '' + diff --git a/ionic/components/tabs/test/badges/main.html b/ionic/components/tabs/test/badges/main.html index 6c9873f2e2..5cbebab529 100644 --- a/ionic/components/tabs/test/badges/main.html +++ b/ionic/components/tabs/test/badges/main.html @@ -11,13 +11,13 @@ - + - + @@ -26,7 +26,7 @@ - + @@ -35,12 +35,12 @@ - + - +