Skip to content

Commit 21fffd0

Browse files
committed
refactor(renderer): xmlAttributes check
1 parent 6cf0b0e commit 21fffd0

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
@@ -18,7 +18,7 @@ import { rendererLog as traceLog, styleError } from "./trace";
1818

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

2424
export type ViewExtensions = ViewExtensions;
@@ -149,10 +149,6 @@ export class ViewUtil {
149149
return view;
150150
}
151151

152-
private isXMLAttribute(name: string): boolean {
153-
return XML_ATTRIBUTES.indexOf(name) !== -1;
154-
}
155-
156152
private platformFilter(attribute: string): string {
157153
let lowered = attribute.toLowerCase();
158154
if (lowered.indexOf(IOS_PREFX) === 0) {
@@ -234,7 +230,7 @@ export class ViewUtil {
234230

235231
if (attributeName === "class") {
236232
this.setClasses(view, value);
237-
} else if (this.isXMLAttribute(attributeName)) {
233+
} else if (XML_ATTRIBUTES.indexOf(attributeName) !== -1) {
238234
view._applyXmlAttribute(attributeName, value);
239235
} else if (specialSetter) {
240236
specialSetter(view, value);

0 commit comments

Comments
 (0)