I do have an Angular component in a for loop like this:
<div *ngFor="let schedule of schedules">
<my-app-component [schedule]="schedule"></my-app-component>
</div>
The MyAppComponent looks like this:
@Component({
selector: 'my-app-component',
templateUrl: '...',
styleUrls: ['...'],
encapsulation: ViewEncapsulation.None
})
export class MyAppComponent implements OnInit {
public disableButtonTrigger: boolean;
ngOnInit() {
this.disableButtonTrigger = false;
}
someFunction() {
...
this.disableButtonTrigger = true; // this should set disableButtonTrigger to true only for this component and not for all components in the loop
...
}
In the MyAppComponent is a boolean trigger to disable buttons in this component. My problem now is if I set disableButtonTrigger = true than all buttons in all components in the for- loop are disabled. May aim would be that only the buttons on the specific component should be diasbled and not in all component. How can I achive this?
disableButtonTrigger = true? Via the parent component? Please add enough code so we can understand better what you are implementing.