第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

Angular 中的簽入組件為空

Angular 中的簽入組件為空

BIG陽 2021-10-14 14:15:39
我有一個 Angular 8 應(yīng)用程序。但是我收到這個錯誤:在一個組件上。它是一個組件中的一個組件。如果組件為空,則將顯示錯誤,如果組件不為空,則不會顯示錯誤:4200/dossier-dossier-module-ngfactory.js:186 ERROR TypeError: Cannot read property 'length' of null    at DossierCorrespondenceItemComponent.push../src/app/dossier/dossier-correspondence-item/dossier-correspondence-item.component.ts.DossierCorrespondenceItemComponent.ngOnInit (:4200/dossier-dossier-module-ngfactory.js:100)    at checkAndUpdateDirectiveInline (vendor.js:37850)    at checkAndUpdateNodeInline (vendor.js:46063)    at checkAndUpdateNode (vendor.js:46025)    at debugCheckAndUpdateNode (vendor.js:46659)    at debugCheckDirectivesFn (vendor.js:46619)    at Object.updateDirectives (:4200/dossier-dossier-module-ngfactory.js:189)    at Object.debugUpdateDirectives [as updateDirectives] (vendor.js:46611)    at checkAndUpdateView (vendor.js:46007)    at callViewAction (vendor.js:46248)在這個組件上:  <app-dossier-correspondence-item    [item]="single"    (goBack)="goBack($event)"    *ngIf="showingSingle">  </app-dossier-correspondence-item></app-vital10-page>這是 ts 代碼:import { Component, OnInit } from '@angular/core';import { HealthAPIService } from '../../shared/health-api/health-api.service';import { DossierEntry } from '../../interfaces/dossier/dossier-entry.interface';@Component({  selector: 'app-dossier-correspondence',  templateUrl: './dossier-correspondence.component.html',})export class DossierCorrespondenceComponent implements OnInit {  allCorrespondence: Array<DossierEntry>;  correspondenceEntries: Array<DossierEntry>;  attachmentEntries: Array<DossierEntry>;  message = '';  emptyMessage = 'Geen correspondentie.';  errorMessage = 'Er ging iets mis met de connectie. Probeer over enkele minuten nogmaals.';  correspondenceLoaded = false;  showingSingle = false;  single: DossierEntry;那么如何解決這個問題呢?謝謝你。所以會很好地解決這個問題
查看完整描述

1 回答

?
紅顏莎娜

TA貢獻(xiàn)1842條經(jīng)驗 獲得超13個贊

當(dāng)您在 gotoItem 中將 ShowingSingle 設(shè)置為 true 時,將啟用該元素。但是在您啟用它的那一刻,您的單身還沒有設(shè)置。請在您的開關(guān)箱之后將 ShowingSingle 設(shè)置為 true。


gotoItem(index, type: string) {


    // NOT HERE


    switch (type) {

      case 'correspondence': {

        this.single = this.correspondenceEntries[index];

        break;

      }

      case 'attachments': {

        this.single = this.attachmentEntries[index];

        break;

      }

      default: {

        break;

      }

    }


    this.showingSingle = true; // BUT HERE

  }


查看完整回答
反對 回復(fù) 2021-10-14
  • 1 回答
  • 0 關(guān)注
  • 160 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號