Gbuomprisco / ngx-chips

Tag Input component for Angular
MIT License
899 stars 359 forks source link

Docs/examples for implementing using Reactive Forms model #977

Open obxpete opened 3 years ago

obxpete commented 3 years ago

PLEASE MAKE SURE THAT:

I'm submitting a ... (check one with "x")

[ ] bug report => search github for a similar issue or PR before submitting
[x] support request/question

I have searched extensively for instructions for implementing chips using model-driven components to no avail.  Am I missing something?  The top line of your readme indicates that we may "use ngModel OR use FormGroup/formControlName (required)" leading me to think this is feasible.  See below for pseudo code.  Thanks in advance.

Notice: feature requests will be ignored, submit a PR if you'd like

Current behavior

I just want to convert this

<tag-input [ngModel]="users | selectedFilter "
    [identifyBy]="'id'"
    [theme]="'minimal'"
    (onRemove)="onUserRemoving($event)"
    [displayBy]="'name'"
    [modelAsStrings]="true"  
    formControlName="toMailTags">
</tag-input>

Expected behavior

Something like this:

<input formControlName="toMailList" [value]="users  | selectedFilter  " >

Where the parameters are managed by the objects rather than tag parameters.

Minimal reproduction of the problem with instructions (if applicable)

What do you use to build your app?. Please specify the version

angular-cli

Angular version:

10

ngx-chips version:

"ngx-bootstrap": "^6.1.0",

Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]