From b552c739f36b937f34eeb0f32bdcec4b28724f0a Mon Sep 17 00:00:00 2001 From: Angelo Scalabroni Date: Thu, 26 Nov 2015 23:38:43 -0500 Subject: [PATCH] add merge of additionalOptions from within the scope into modal instance --- src/modal/modal.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/modal/modal.js b/src/modal/modal.js index 910d7d3..9cd602b 100644 --- a/src/modal/modal.js +++ b/src/modal/modal.js @@ -9,12 +9,16 @@ angular.module('angularify.semantic.modal', []) transclude: true, require: 'ngModel', template: '', - link: function (scope, element, attrs, ngModel) { - element.modal({ + link: function (scope, element, attrs, ngModel) { + var options = { onHide: function () { - ngModel.$setViewValue(false); + ngModel.$setViewValue(false); } - }); + }; + if (scope.additionalOptions != undefined) { + for (var attrname in scope.additionalOptions) { options[attrname] = scope.additionalOptions[attrname]; } + } + element.modal(options); scope.$watch(function () { return ngModel.$modelValue; }, function (modelValue){