angularify / angular-semantic-ui

[WiP] AngularJS native directives for Semantic UI
http://angularify.github.io/angular-semantic-ui
MIT License
383 stars 87 forks source link

add merge of additionalOptions object from the scope into modal instance options #58

Open ascalabro opened 8 years ago

ascalabro commented 8 years ago

Enable the setting of additional options to the modal instance. These options should be property additionalOptions, of the scope, which gets merged into the default modal options object in the directive. Without a change like this one, it is not possible to set modal options other than the default from the directive..

ascalabro commented 8 years ago

Set $scope.additionalOptions in the controller and these will become options for the modal

$scope.additionalOptions = {
        onShow: function() {
            console.log('scope options sent in scope.additionalOptions.onShow');
        },
        closable  : false,
        onDeny    : function(){
            console.log('Denied');
            return false;
        },
        onApprove : function() {
            alert('Approved!');
        }
    };