Ahlushko

Untitled

Jun 16th, 2020
911
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import { Component, OnInit } from '@angular/core';
  2. import { Router } from '@angular/router'
  3. import { CompService } from '@services'
  4. import { NgxIzitoastService } from 'ngx-izitoast';
  5. import { SearchPipe } from '../search.pipe'
  6. @Component({
  7.     selector: 'app-header',
  8.     templateUrl: './header.component.html',
  9.     styleUrls: ['./header.component.css']
  10. })
  11. export class HeaderComponent implements OnInit {
  12.     public edit: any = {}
  13.     public add: boolean = false
  14.     public comp: any = {}
  15.     public properties = ['videoCard', 'CPU', 'motherboard', 'RAM']
  16.     constructor(
  17.         public pc: CompService,
  18.         public alert: NgxIzitoastService
  19.         ) {}
  20.     update(id) {
  21.         this.edit._id = id
  22.         this.pc.update(this.edit)
  23.     }
  24.     delete(item) {
  25.         this.alert.question({
  26.             backgroundColor: 'white',
  27.             title: 'Ви впевнені?',
  28.             message: '',
  29.             buttons: [
  30.             ['<button>Так</button>', (instance, toast) => {
  31.                 this.pc.delete(item)
  32.                 instance.hide({ transitionOut: 'fadeOut' }, toast, 'button');
  33.             }, true],
  34.             ['<button>Ні</button>', function (instance, toast) {
  35.                 instance.hide({ transitionOut: 'fadeOut' }, toast, 'button');
  36.             }]
  37.             ]
  38.         })
  39.     }
  40.     ngOnInit(): void {
  41.     }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment