Skip to content

Commit

Permalink
fix(TabViewItemDirective ): textTransform property added (#1315)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
bhavincb authored and SvetoslavTsenov committed May 21, 2018
1 parent cb8d17e commit 11d01f9
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions nativescript-angular/directives/tab-view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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();
Expand All @@ -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);
Expand Down

0 comments on commit 11d01f9

Please sign in to comment.