Gbuomprisco / ngx-chips

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

onRemoving scope variable #941

Open elvispdosreis opened 4 years ago

elvispdosreis commented 4 years ago

PLEASE MAKE SURE THAT:

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

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

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

Expected behavior

inside onRemoving I don't have access to external variables like this.http, it is undefined

<tag-input [onRemoving]="onRemoving">

constructor(private http: HttpClient) {
}

public onRemoving(tag: TagModel): Observable<TagModel> {
        console.log(this.http);
        return this.http.delete<TagModel>('/api/upload/' + tag.id).pipe(map(r => {
            return tag;
        }));
 }

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

angular-cli

Angular version:

9.0.1

ngx-chips version: 2.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 ]

all