错误TS1128:需要声明或声明。角度误差

时间:2020-01-21 20:11:17

标签: entity-framework angular7

我有一个简单的功能,可以接收来自服务的所有通知。尽管ut给了我给定的错误。 我想从角度使用服务获取所有详细信息,该服务发送到在实体框架中工作的.net服务器。

manager-home.ts:


clients: client_table[];
  cols: any[];
  flag: boolean;
  notes: notifications_table[];

  selectedClient: client_table;
  constructor(private noteservice: NotificationService, private router: Router, private generalService: GeneralService, private clientsService: ClientsService, private propertyService: PropertyService, private exptetionService: ExptetionService) { }


  ngOnInit() {
    this.clientsService.GetClients().subscribe(data => {
      this.clients = data;
    });
    this.noteservice.getAllNotification().subscribe(data => {
      this.notes = data;

    });
    this.flag = false;


  }

NotificationService:

export class NotificationService {

  constructor(private http: HttpClient) { }

  AddNote(note:notifications_table): Observable<any>{
    return this.http.post<notifications_table>(BASE_SERVER_URL+'Notifications',note);

  }
  getAllNotification():Observable<notifications_table[]>{
    return this.http.get<notifications_table[]>(BASE_SERVER_URL + "Notifications/GetAllNotification" );}



}

0 个答案:

没有答案