Ngx-chips: add tags dynamically

Created on 20 Feb 2019  路  4Comments  路  Source: Gbuomprisco/ngx-chips

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

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

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

basically, I have tags with children tags and on click on this parent tag I have to bind all it children to
the input field, the question is how to add an item of objects to my ng module dynamically?

Current behavior

Expected behavior

Minimal reproduction of the problem with instructions (if applicable)

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

angular 7
Angular version:

angular 7

ngx-chips version:

2.0.0 beta
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 ]

chrome

Most helpful comment

That's the correct approach

All 4 comments

on the other way, can onAdding observable allow Array of tags?

@Gbuomprisco if this is somthing already there please you help needed .

Much appreciated :)

my solution in case if anyone faced the same

[(ngModel)]="items"
then onAdding

this.items = [...this.items, ...tags];
reassign array did the job for me instead of pushing the updated array of tags

and for the observable onAdding you can return empty tag like so

 return of({
        value: null,
        display: null,
        readonly: true
      });

That's the correct approach

my solution in case if anyone faced the same

[(ngModel)]="items"
then onAdding

this.items = [...this.items, ...tags];
reassign array did the job for me instead of pushing the updated array of tags

and for the observable onAdding you can return empty tag like so

 return of({
        value: null,
        display: null,
        readonly: true
      });

@HDaghash, Can you please provide full code example?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

altschuler picture altschuler  路  3Comments

neilharding picture neilharding  路  5Comments

MrBra1nwash picture MrBra1nwash  路  4Comments

matthewerwin picture matthewerwin  路  5Comments

lukas-bernert picture lukas-bernert  路  4Comments