Skip to content

Instantly share code, notes, and snippets.

@jlebrech jlebrech/directive.js Secret
Created Dec 22, 2014

Embed
What would you like to do?
can i rewrite doing scope.method()(params)?
/* directive */
function modalOverlay ($sce, $parse, uuid) {
return {
restrict: 'E',
transclude: true,
scope: {
data: '=',
onComplete: '&'
},
templateUrl: 'views/directives/modal_overlay.html',
link: function (scope, element, attrs) {
...
scope.onSuccess = function(response){
scope.onComplete()(response.data) // can I rewrite this onComplete()() thing?
}
...
}
}
}
angular
.module('adminPanelAngularApp')
.directive('modalOverlay', modalOverlay);
<modal-overlay data="modalData" on-complete="modalComplete"></modal-overlay>
....
scope.modalComplete = function(e){
// e is the data send from directive.js#15
debugger
};
....
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.