Skip to content

Commit

Permalink
Add an ngxBindings option for supporting downgraded ngx components
Browse files Browse the repository at this point in the history
  • Loading branch information
DougKeller committed Nov 10, 2020
1 parent b8ad268 commit 8bc68d2
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions dst/angular-modal-service.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dst/angular-modal-service.min.js

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

2 changes: 1 addition & 1 deletion dst/angular-modal-service.min.js.map

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

5 changes: 3 additions & 2 deletions src/angular-modal-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,12 @@ module.provider('ModalService', function ModalServiceProvider() {
};

var componentHandle = kebabCase(options.component);
var template = '<' + componentHandle + ' close="close"';
var template = '<' + componentHandle + (options.ngxBindings ? ' [close]="close"' : ' close="close"');
var inputKeys = Object.keys(options.bindings || {})
if (inputKeys.length > 0) {
var bindingAttributes = inputKeys.map(function(inputKey) {
return kebabCase(inputKey) + '="bindings.' + inputKey + '"';
var attr = options.ngxBindings ? '[' + kebabCase(inputKey) + ']' : kebabCase(inputKey);
return attr + '="bindings.' + inputKey + '"';
});
template += ' ' + bindingAttributes.join(' ');
}
Expand Down

0 comments on commit 8bc68d2

Please sign in to comment.