Skip to content

Instantly share code, notes, and snippets.

@mwagena
mwagena / delete-confirm.component.ts
Created March 21, 2017 10:46
Button with confirmation
import { Component, EventEmitter, Output, Input } from '@angular/core';
@Component({
selector: 'delete-confirm',
template: `
<button class="btn btn-danger" (click)="showConfirm()">
{{btn_txt}}
</button>
`,
})
@mwagena
mwagena / ng-really.js
Last active November 22, 2017 16:34 — forked from asafge/ng-really.js
Updatet script to use Bootstrap Modals
/**
* 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;