Ngx-chips: how to popluate data if we are using formControlname

Created on 2 May 2018  路  6Comments  路  Source: Gbuomprisco/ngx-chips

HTML

 <form role="form" [formGroup]="form" >
 <tag-input formControlName="items" (onSelect)="onSelect($event)"></tag-input>
</form>

in .ts file

 this.form = this.formBuilder.group({
      items:new FormControl(''),
    });

Most helpful comment

Hi @ashokthrymr, a bunch of problems not related to the library I can see:

All 6 comments

That should work but you need to initialise with an array. Check the demo in the repository. Please complete template next time, don't remove ir

Hi..Gbuomprisco I am Providing Stackbliz code.Let me know where ever made wrong.

https://stackblitz.com/edit/angular4-a9g1lb?file=app%2Fapp.component.html
Copy Link open in tab
1) I have two problems ,One is populating data using formControlname

2)When I am entering data in TagInput,previous value appening to next value

Hi @ashokthrymr, a bunch of problems not related to the library I can see:

Thanks you @Gbuomprisco .It helps.
https://stackblitz.com/edit/angular4-a9g1lb?file=app%2Fapp.component.ts
Small help.....Open the Link check the output then you will know the issue better
from second value onwards not showing the value properly.when I click on those item then it's expanding

The example uses Angular 4, but should use Angular 5 (or 6 with the latest version)

Thanks for your Support

Was this page helpful?
0 / 5 - 0 ratings

Related issues

RaghulXander picture RaghulXander  路  3Comments

rspandi1985 picture rspandi1985  路  4Comments

lukas-bernert picture lukas-bernert  路  4Comments

Gbuomprisco picture Gbuomprisco  路  4Comments

matthewerwin picture matthewerwin  路  5Comments