Skip to content

关于questionnaire-item.component的ngOnChanges #13

Open
@clfeng

Description

@clfeng

github上代码

  ngOnChanges(changes: SimpleChanges){
      let questionnaireChange = changes['questionnaire'];
      if(questionnaireChange.previousValue.state && 
            questionnaireChange.currentValue.state !== questionnaireChange.previousValue.state){
          this.questionnaire = changes['questionnaire'].currentValue;
          this.setState();
      }
  }

官网PAI


class SimpleChange {
constructor(previousValue: any, currentValue: any, firstChange: boolean)
previousValue : any
currentValue : any
firstChange : boolean
isFirstChange() : boolean
}

通过changes为SimpleChanges的一个对象实例,那么应该不具有questionnaire方法吧?表示那不大理解,像老师请教一下。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions