Support lower-case-dashed component declaration in the XML added

This commit is contained in:
Vladimir Enchev
2015-07-23 16:46:12 +03:00
parent d83e3a6ccd
commit 5bb52f545d
2 changed files with 14 additions and 0 deletions

View File

@@ -35,6 +35,9 @@ export function getComponentModule(elementName: string, namespace: string, attri
var instanceModule: Object;
var componentModule: definition.ComponentModule;
// Support lower-case-dashed component declaration in the XML (https://github.com/NativeScript/NativeScript/issues/309).
elementName = elementName.split("-").map(s => { return s[0].toUpperCase() + s.substring(1) }).join("");
// Get module id.
var moduleId = MODULES[elementName] || UI_PATH +
(elementName.toLowerCase().indexOf("layout") !== -1 ? "layouts/" : "") +