From 11d01f97944d49f356f57c7a333896e505e85770 Mon Sep 17 00:00:00 2001 From: Bhavin Jalodara Date: Mon, 21 May 2018 21:13:46 +0530 Subject: [PATCH] fix(TabViewItemDirective ): textTransform property added (#1315) * textTransform property to TabViewItemDirective textTransform property added to TabViewItemDirective so that in angular tabItem textTransformation can be changed. * removed tailing whitespace removed tailing whitespace which was causing build failed. --- nativescript-angular/directives/tab-view.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/nativescript-angular/directives/tab-view.ts b/nativescript-angular/directives/tab-view.ts index a945531f9..dcec81529 100644 --- a/nativescript-angular/directives/tab-view.ts +++ b/nativescript-angular/directives/tab-view.ts @@ -8,6 +8,7 @@ import { ViewContainerRef, } from "@angular/core"; import { TabView, TabViewItem } from "tns-core-modules/ui/tab-view"; +import { TextTransform } from "tns-core-modules/ui/text-base"; import { InvisibleNode } from "../element-registry"; import { rendererLog } from "../trace"; @@ -53,6 +54,7 @@ export class TabViewItemDirective implements OnInit { private item: TabViewItem; private _title: string; private _iconSource: string; + private _textTransform: TextTransform; constructor( private owner: TabViewDirective, @@ -89,6 +91,20 @@ export class TabViewItemDirective implements OnInit { } } + + @Input() + get textTransform() { + return this._textTransform; + } + + set textTransform(value: TextTransform) { + if (this._textTransform !== value) { + this._textTransform = value; + this.ensureItem(); + this.item.textTransform = this._textTransform; + } + } + private ensureItem() { if (!this.item) { this.item = new TabViewItem(); @@ -100,6 +116,7 @@ export class TabViewItemDirective implements OnInit { if (this.config) { this.item.title = this._title || this.config.title; this.item.iconSource = this._iconSource || this.config.iconSource; + this.item.textTransform = this._textTransform || this.config.textTransform; } const viewRef = this.viewContainer.createEmbeddedView(this.templateRef);