Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import { Component, OnInit, SystemJsNgModuleLoader } from '@angular/core';
- import { NgForm } from '@angular/forms';
- import { Prodotti } from 'src/app/model/prodotti.model';
- import { Router, ActivatedRoute } from '@angular/router';
- import { JsonPipe } from '@angular/common';
- import { ProdottiListService} from 'src/app/features/prodotti/components/prodotti-list/prodotti-list.service';
- import { ToastrService } from 'ngx-toastr';
- let Header_Msg = "Gestione Prodotti";
- @Component({
- selector: 'app-prodotti-list',
- templateUrl: './prodotti-list.component.html',
- styleUrls: ['./prodotti-list.component.css']
- })
- export class ProdottiListComponent implements OnInit {
- constructor(private service: ProdottiListService, private toastr: ToastrService) {
- }
- ngOnInit() {
- this.service.refreshList();
- }
- populateForm(emp: Prodotti) {
- this.service.formData = Object.assign({}, emp);
- }
- onDelete(id: number) {
- if (confirm('Confermi la cancellazione del Record ?')) {
- this.service.deleteProdotti(id).subscribe(res => {
- this.service.refreshList();
- this.toastr.warning('Cancellazione eseguita con successo', Header_Msg);
- })
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement