mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-14 18:26:26 +00:00
20 lines
545 B
JavaScript
20 lines
545 B
JavaScript
/* global angular */
|
|
angular.module('codexen')
|
|
.directive('btnDeleteSnippet', function (Modal, $rootScope) {
|
|
return {
|
|
scope: {
|
|
snippet: '=btnDeleteSnippet'
|
|
},
|
|
link: function (scope, el) {
|
|
el.on('click', function () {
|
|
Modal.deleteSnippet(scope.snippet)
|
|
.result.then(function (snippet) {
|
|
$rootScope.$broadcast('snippetDeleted', snippet)
|
|
}, function () {
|
|
console.log('delete snippet modal dismissed')
|
|
})
|
|
})
|
|
}
|
|
}
|
|
})
|