Не удается найти модуль async_hooks. в угловой - PullRequest
0 голосов
/ 08 ноября 2019

Я использую Angular 8, где я сталкиваюсь с ошибкой - -> ОШИБКА в клиентском компоненте ** Не удается найти модуль 'async_hooks' . **

ERROR in src/app/customer/customer.component.ts:7:27 - error TS2307: Cannot find module 'async_hooks'.

7 import { currentId } from 'async_hooks';

Я пытался найтив Google об этой ошибке, но предложения показывают, что ошибка больше связана с узлом Ну, я попытался импортировать {currentId} из 'async_hooks';в моем модуле, но все еще показывает ту же ошибку

Просто хотел сообщить, что я использую Угловая таблица материалов https://material.angular.io/components/table/overview

Я делюсь своим customer.component.ts посмотрите на это

import { Component, OnInit, ViewChild } from '@angular/core';
import { CustomerService } from '../_service/customer/customer.service';
import {MatTableDataSource} from '@angular/material/table';
import {MatPaginator} from '@angular/material/paginator';
import { MatSort } from '@angular/material';
import { trigger, state, transition, style, animate } from '@angular/animations';
import { currentId } from 'async_hooks';


@Component({
  selector: 'app-customer',
  templateUrl: './customer.component.html',
  styleUrls: ['./customer.component.scss'],
  animations: [
    trigger('detailExpand', [
      state('collapsed', style({height: '0px', minHeight: '0'})),
      state('expanded', style({height: '*'})),
      transition('expanded <=> collapsed', animate('225ms cubic-bezier(0.4, 0.0, 0.2, 1)')),
    ]),
  ],
})
export class CustomerComponent implements OnInit {
  columnsToDisplay: string[] = ['customerName', 'customerPhone', 'customerEmail', 'created_at'];
  dataSource : any;
  expandedElement : any;
  addCustomer : boolean = false;
  ProposalByCustomer : any;

  constructor(public rest : CustomerService) { }

ngOnInit(){
  this.getCustomer();
}

getCustomer() {
     this.rest.getCustomers(localStorage.getItem('currentUser')).subscribe(result => {
       console.log(result);
        if(result['status'] == 1){
           this.dataSource = result['value'];
        }

       });
}

applyFilter(filterValue: string) {
  this.dataSource.filter = filterValue.trim().toLowerCase();

  if (this.dataSource.paginator) {
    this.dataSource.paginator.firstPage();
  }
}

getProposalByCustomer(customer){
   console.log(customer);
   let  token = localStorage.getItem('currentUser');
   console.log(token);
   let data = {customerId :  customer.customerId};
   console.log(data);
   this.rest.getProposalByCustomer(data , token).subscribe(result => {
    console.log(result);
    if(result['status'] == 1){
      this.ProposalByCustomer = result['data'];
    }
  })
}

addCustmr() {
     this.addCustomer = !this.addCustomer;
    }
}
...