Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sui-select-option with formArray not working #434

Open
kaoecoito opened this issue Apr 2, 2019 · 1 comment
Open

sui-select-option with formArray not working #434

kaoecoito opened this issue Apr 2, 2019 · 1 comment

Comments

@kaoecoito
Copy link

Hi, I'm trying to use sui-multi-select with formArray and I could not get it to work.
I'm putting formArrayName in the sui-multi-select tag and the formControlName in the sui-select-option tag similar to this.

<sui-multi-select class="selection"
              labelField="nome" valueField="id"
	      formArrayName="modalidade"
              [hasLabels]="false">
<sui-select-option *ngFor="let option of modalidadesFiltradas"
		 formControlName="selecionado"
                 [value]="option">
</sui-select-option>
</sui-multi-select>

It informs that I can not find a control in the path modalidade -> selecionado

I seem to be missing something in the sui-select-option tag.

@kaoecoito
Copy link
Author

I saw that it was doing the wrong way, even using as the groupName in the index still of the error.

            <sui-multi-select class="selection"
                              labelField="nome" valueField="id"
                              formArrayName="modalidades"
                              [hasLabels]="false">
              <ng-container *ngFor="let option of modalidadesFiltradas;let i=index" [formGroupName]="i">
                <sui-select-option [value]="option" formControlName="selecionado">
                </sui-select-option>
              </ng-container>
            </sui-multi-select>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant