This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component, EventEmitter, Output, Input } from '@angular/core'; | |
@Component({ | |
selector: 'delete-confirm', | |
template: ` | |
<button class="btn btn-danger" (click)="showConfirm()"> | |
{{btn_txt}} | |
</button> | |
`, | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* A generic confirmation for risky actions. | |
* Usage: Add attributes: ng-really-message="Are you sure"? ng-really-click="takeAction()" ng-really-title="Delete this?" function | |
*/ | |
angular.module('app').directive('ngReallyClick', ["$modal", "$timeout", function($modal, $timeout) { | |
return { | |
restrict: 'A', | |
link: function(scope, element, attrs) { | |
return element.bind('click', function() { | |
var message, title; |