ngx-toastr не работает над webapi с angular на visual studio 2017 - PullRequest
0 голосов
/ 20 марта 2019

Я создал проект webapi с угловым. Все работает нормально, за исключением случаев, когда я пытаюсь import { ToastrModule } from 'ngx-toastr'; в моем app.module.ts. Я установил его в папку «ClientApp»:

enter image description here

примерно так: npm install ngx-toastr --save и npm install @angular/animations --save но это не работает, это единственное, что я получаю даже в своих devtools

Не удается получить /

Осуществление

upload(id) {
    if (id == null)
            return;

      let selectedFile = this.uploader.queue.find(s => s.id == id);
      if (selectedFile) {
        console.log(selectedFile.id);
        const formData = new FormData();
        //formData.append(selectedFile.file.name, selectedFile.file);
        formData.append(selectedFile.id, selectedFile.file);
        const uploadReq = new HttpRequest('POST', `api/upload`, formData, {
          reportProgress: true,
        });

        this.http.request(uploadReq).subscribe(event => {
          if (event.type === HttpEventType.UploadProgress) {
            selectedFile.progress = Math.round(100 * event.loaded / event.total);
          }
          else if (event.type === HttpEventType.Response) {
            selectedFile.message = event.body.toString();
            this.toastr.success('Successfully uploaded file', 'Notification');
            //this.ngxSmartModalService.getModal('myModal').open()
            this.service.getUploads();
          }
        });
      }
  }

Где мне установить ngx-toasr? Что я здесь не так делаю? Спасибо.

...