Skip to content

Commit 736dc80

Browse files
committed
refactor(renderer): xmlAttributes check
1 parent 4b19d1d commit 736dc80

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

Diff for: nativescript-angular/renderer.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import {
55
} from "@angular/core";
66
import { APP_ROOT_VIEW, DEVICE } from "./platform-providers";
77
import { isBlank } from "./lang-facade";
8-
import { View } from "ui/core/view";
8+
import { View } from "tns-core-modules/ui/core/view";
99
import { addCss } from "application";
10-
import { topmost } from "ui/frame";
10+
import { topmost } from "tns-core-modules/ui/frame";
1111
import { ViewUtil } from "./view-util";
1212
import { NgView } from "./element-registry";
1313
import { rendererLog as traceLog } from "./trace";

Diff for: nativescript-angular/view-util.ts

+2-6
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { rendererLog as traceLog } from "./trace";
1515

1616
const IOS_PREFX: string = ":ios:";
1717
const ANDROID_PREFX: string = ":android:";
18-
const XML_ATTRIBUTES = Object.freeze([ "style", "row", "columns", "fontAttributes"]);
18+
const XML_ATTRIBUTES = Object.freeze(["style", "rows", "columns", "fontAttributes"]);
1919
const whiteSpaceSplitter = /\s+/;
2020

2121
export type ViewExtensions = ViewExtensions;
@@ -146,10 +146,6 @@ export class ViewUtil {
146146
return view;
147147
}
148148

149-
private isXMLAttribute(name: string): boolean {
150-
return XML_ATTRIBUTES.indexOf(name) !== -1;
151-
}
152-
153149
private platformFilter(attribute: string): string {
154150
let lowered = attribute.toLowerCase();
155151
if (lowered.indexOf(IOS_PREFX) === 0) {
@@ -230,7 +226,7 @@ export class ViewUtil {
230226

231227
if (attributeName === "class") {
232228
this.setClasses(view, value);
233-
} else if (this.isXMLAttribute(attributeName)) {
229+
} else if (XML_ATTRIBUTES.indexOf(attributeName) !== -1) {
234230
view._applyXmlAttribute(attributeName, value);
235231
} else if (propMap.has(attributeName)) {
236232
// We have a lower-upper case mapped property.

0 commit comments

Comments
 (0)