import { Component , OnInit , Input , Injector } from '@angular/core' ; import { RequestsService } from "../../services/requests/requests.service" ; import { PopupItem } from "../../models/popup-item.model" ; @ Component ( { selector : 'app-pending-approval-actions' , templateUrl : './pending-approval-actions.component.html' , styleUrls : [ './pending-approval-actions.component.scss' ] } ) export class PendingApprovalActionsComponent implements OnInit { public row ; public showDialog = false ; public optionsList = [ new PopupItem ( 'Email' , 'fa fa-envelope-o' , ( ) => { this . email ( ) ; } ) , new PopupItem ( 'Resend' , 'fa fa-refresh' , ( ) => { this . resend ( ) ; } ) ] ; constructor ( private injector , private requestsService ) { this . row = injector . get ( 'row' ) ; } ngOnInit ( ) { } email ( ) { this . requestsService . emailRequestOwner ( 0 , 0 ) . then ( ( response ) => { console . log ( 'emailed!' , this . row ) ; } ) ; } resend ( ) { this . requestsService . resendRequest ( 0 , 0 ) . then ( ( response ) => { console . log ( 'resend' , this . row ) ; } ) ; } toggleDialog ( $event ) { this . showDialog = ! this . showDialog ; $event . stopPropagation ( ) ; } }