mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 03:31:45 +08:00
fileName change to path and componentName changed to name
This commit is contained in:
@ -42,8 +42,8 @@ export function test_load_ShouldNotCrashWithoutExports() {
|
|||||||
|
|
||||||
export function test_loadWithOptionsNoXML() {
|
export function test_loadWithOptionsNoXML() {
|
||||||
var v = builder.load({
|
var v = builder.load({
|
||||||
fileName: "~/xml-declaration/mymodule",
|
path: "~/xml-declaration/mymodule",
|
||||||
componentName: "MyControl",
|
name: "MyControl",
|
||||||
exports: exports
|
exports: exports
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -52,8 +52,8 @@ export function test_loadWithOptionsNoXML() {
|
|||||||
|
|
||||||
export function test_loadWithOptionsWithXML() {
|
export function test_loadWithOptionsWithXML() {
|
||||||
var v = builder.load({
|
var v = builder.load({
|
||||||
fileName: "~/xml-declaration/mymodulewithxml",
|
path: "~/xml-declaration/mymodulewithxml",
|
||||||
componentName: "MyControl",
|
name: "MyControl",
|
||||||
exports: exports
|
exports: exports
|
||||||
});
|
});
|
||||||
TKUnit.assert(v instanceof view.View, "Expected result: View; Actual result: " + v + ";");
|
TKUnit.assert(v instanceof view.View, "Expected result: View; Actual result: " + v + ";");
|
||||||
@ -61,8 +61,8 @@ export function test_loadWithOptionsWithXML() {
|
|||||||
|
|
||||||
export function test_loadWithOptionsFromTNS() {
|
export function test_loadWithOptionsFromTNS() {
|
||||||
var v = builder.load({
|
var v = builder.load({
|
||||||
fileName: "ui/label",
|
path: "ui/label",
|
||||||
componentName: "Label"
|
name: "Label"
|
||||||
});
|
});
|
||||||
|
|
||||||
TKUnit.assert(v instanceof labelModule.Label, "Expected result: Label; Actual result: " + v + ";");
|
TKUnit.assert(v instanceof labelModule.Label, "Expected result: Label; Actual result: " + v + ";");
|
||||||
@ -70,8 +70,8 @@ export function test_loadWithOptionsFromTNS() {
|
|||||||
|
|
||||||
export function test_loadWithOptionsFromTNSPath() {
|
export function test_loadWithOptionsFromTNSPath() {
|
||||||
var v = builder.load({
|
var v = builder.load({
|
||||||
fileName: "tns_modules/ui/label",
|
path: "tns_modules/ui/label",
|
||||||
componentName: "Label"
|
name: "Label"
|
||||||
});
|
});
|
||||||
|
|
||||||
TKUnit.assert(v instanceof labelModule.Label, "Expected result: Label; Actual result: " + v + ";");
|
TKUnit.assert(v instanceof labelModule.Label, "Expected result: Label; Actual result: " + v + ";");
|
||||||
|
4
ui/builder/builder.d.ts
vendored
4
ui/builder/builder.d.ts
vendored
@ -7,8 +7,8 @@ declare module "ui/builder" {
|
|||||||
export function parse(value: string, exports?: any): view.View;
|
export function parse(value: string, exports?: any): view.View;
|
||||||
|
|
||||||
export interface LoadOptions {
|
export interface LoadOptions {
|
||||||
fileName: string;
|
path: string;
|
||||||
componentName: string;
|
name: string;
|
||||||
exports?: any;
|
exports?: any;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -227,7 +227,7 @@ export function load(arg: any): view.View {
|
|||||||
if (arguments.length === 1) {
|
if (arguments.length === 1) {
|
||||||
if (!types.isString(arguments[0])) {
|
if (!types.isString(arguments[0])) {
|
||||||
var options = <definition.LoadOptions>arguments[0];
|
var options = <definition.LoadOptions>arguments[0];
|
||||||
componentModule = loadCustomComponent(options.fileName, options.componentName, undefined, options.exports);
|
componentModule = loadCustomComponent(options.path, options.name, undefined, options.exports);
|
||||||
} else {
|
} else {
|
||||||
componentModule = loadInternal(<string>arguments[0]);
|
componentModule = loadInternal(<string>arguments[0]);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user