Skip to content

Commit

Permalink
fix(runtime): error when using models with configuration file
Browse files Browse the repository at this point in the history
Fixes ALOY-1598
  • Loading branch information
feons authored and ewanharris committed Oct 24, 2019
1 parent 4418a13 commit 0d6a312
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
11 changes: 5 additions & 6 deletions Alloy/commands/compile/styler.js
Expand Up @@ -578,20 +578,19 @@ exports.generateStyleParams = function(styles, classes, id, apiName, extraStyle,
} else if (referencePath[0] === '$') {
// instance model binding
attribute = referencePath.splice(2, referencePath.length);
} else if (_.includes(CU.models, referencePath[0])) {
// global model binding
attribute = referencePath.splice(1, referencePath.length);
referencePath.unshift('Alloy', 'Models');
} else {
} else if (collectionModelVar !== CONST.BIND_MODEL_VAR) {
// collection binding (deep)
bindsCollection = true;
} else {
// default to global model binding
attribute = referencePath.splice(1, referencePath.length);
referencePath.unshift('Alloy', 'Models');
}

// model binding
if (attribute !== undefined) {
modelVar = fromPath(referencePath);
reference = fromPath(referencePath.concat(CONST.BIND_TRANSFORM_VAR, attribute));

if (!_.includes(bindsModels, modelVar)) {
bindsModels.push(modelVar);
}
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0d6a312

Please sign in to comment.