Angular ForEach in Angular4/Typescript?

前端 未结 4 962
说谎
说谎 2021-02-18 19:49

I see many answers about using ngFor when I search for this, but I understand ngFor. I\'m asking about the angular.forEach() constructor used in my Angular 1 contr

4条回答
  •  無奈伤痛
    2021-02-18 20:20

    you can try typescript's For :

    selectChildren(data , $event){
       let parentChecked : boolean = data.checked;
       for(let o of this.hierarchicalData){
          for(let child of o){
             child.checked = parentChecked;
          }
       }
    }
    

提交回复
热议问题