Merge pull request #475 from NativeScript/lower-case-dashed

Support lower-case-dashed component declaration in the XML added
This commit is contained in:
Vladimir Enchev
2015-07-24 10:44:35 +03:00
2 changed files with 13 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/" : "") +