Angular ForEach in Angular4/Typescript?

前端 未结 4 945
说谎
说谎 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:29

    in angular4 foreach like that. try this.

     selectChildren(data, $event) {
          let parentChecked = data.checked;
           this.hierarchicalData.forEach(obj => {
              obj.forEach(childObj=> {
                value.checked = parentChecked;
             });
          });
        }
    

提交回复
热议问题