Skip to content

Instantly share code, notes, and snippets.

@zimejin
Forked from Bilkiss/item.component.html
Created January 19, 2022 15:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zimejin/1e3cef31de09f7f740b06f176217ad38 to your computer and use it in GitHub Desktop.
Save zimejin/1e3cef31de09f7f740b06f176217ad38 to your computer and use it in GitHub Desktop.
<button (click)=”deleteItem()”>Delete item</button>
import { Component, OnInit } from '@angular/core';
import { Confirmable } from '../decorators/confirmable.decorator';
@Component({
selector: 'app-item',
templateUrl: ‘./item.component.html',
styleUrls: ['./item.component.scss']
})
export class ItemComponent implements OnInit {
constructor() {}
ngOnInit(): void {}
@Confirmable({ title: 'Are you sure', html: 'Do you want to delete this item?’, icon: 'warning'})
deleteItem(): void {
//Code to delete your item
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment