W
W
Worgen2019-06-25 12:07:56
Angular
Worgen, 2019-06-25 12:07:56

Is it possible to pass data from ngFor to another component?

Hello, I have the following code:

<div *ngFor="let parameter of parametersProfile">
            <app-input-boolean [(parameter)]="parameter" class="col" *ngIf="parameter.parameterType == 'System.Boolean'"></app-input-boolean>
            <app-input-data-time [(parameter)]="parameter" class="col" *ngIf="parameter.parameterType == 'System.DateTime'"></app-input-data-time>
            <app-input-string [(parameter)]="parameter" class="col" *ngIf="parameter.parameterType == 'System.String'"></app-input-string>
        </div>

Can I transfer data to another component in this way? Because I get the following error: Error: Cannot assign to a reference or variable!

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question