question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

onTextChange.filter is not a function

See original GitHub issue

I’m submitting a … (check one with “x”)

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

Current behavior

I’m getting the following error when trying to initialize a component using the taginput. As a result, I’m not getting text change notifications which I need when trying to use the observable source rather than autocompleteitems for other controls as well.

TypeError: this.tagInput.onTextChange.filter is not a function
    at TagInputDropdown.ngOnInit (tag-input-dropdown.component.ts:159)
    at checkAndUpdateDirectiveInline (provider.ts:272)
    at checkAndUpdateNodeInline (view.ts:505)
    at checkAndUpdateNode (view.ts:443)
    at debugCheckAndUpdateNode (services.ts:377)
    at debugCheckDirectivesFn (services.ts:464)
    at Object.View_CrimeComponent_1._co [as updateDirectives] (Crime.html:63)
    at Object.debugUpdateDirectives [as updateDirectives] (services.ts:443)
    at checkAndUpdateView (view.ts:359)
    at callViewAction (view.ts:765)

Expected behavior

I wouldn’t see the error and suggestions would be filtered on keypress.

Minimal reproduction of the problem with instructions (if applicable) I’ve used the following markup for my sample. The model appears to bind and autocompleteitems show.

                    <tag-input name="Race" 
                               [(ngModel)]="model.Victim.Race" 
                               [onlyFromAutocomplete]="true"
                               [placeholder]="'Select all that apply'"
                               >
                        <tag-input-dropdown 
                               [autocompleteItems]="model.RacesValues"
                               [showDropdownIfEmpty]="true"
                               [displayBy]="'Value'"
                               [identifyBy]="'Value'"></tag-input-dropdown>
                    </tag-input>

What is the motivation / use case for changing the behavior? (if applicable)

What do you use to build your app? (SystemJS, Webpack, angular-cli, etc.). Please specify the version SystemJS - ^0.20.14

Angular version: 4.2.4

ng2-tag-input version: ngx-chips: ^1.4.5-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 ] Tested on chrome and Edge

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

14reactions
malsmithcommented, Aug 8, 2017

The error I got was: this.tagInput.onTextChange.debounceTime is not a function

In case others find this issue - your angular component file where you declare an @Component MUST have these two lines in the import section

import ‘rxjs/add/operator/filter’; import ‘rxjs/add/operator/debounceTime’;

10reactions
MmtBkncommented, Aug 18, 2017

Let’s make it 3 (I think) if you have dropdown too, but why?

import ‘rxjs/add/operator/filter’; import ‘rxjs/add/operator/debounceTime’; import ‘rxjs/add/operator/map’;

Read more comments on GitHub >

github_iconTop Results From Across the Web

filter is not a function [duplicate] - Stack Overflow
filter is a method on arrays. Since the code you posted contains an object, you're seeing this error. You may want to apply...
Read more >
google earth engine - Error: "l8.filter is not a function"
Here is where you are calling l8.filter() . var img = l8.filter(ee. ... You can't do collection operations like filtering to an image....
Read more >
About filter functions - Google Ads Editor Help
What's changed: Filter by contained items. Previously, filters could only inspect values directly on the items being filtered. Functions allow for queries on ......
Read more >
React interactivity: Editing, filtering, conditional rendering
filter () because we want to return a new array with some changes, instead of deleting something from the array. Add the editTask()...
Read more >
TypeError: filter is not a function in JavaScript | bobbyhadz
The "filter is not a function" error occurs when we call the `filter()` method on a value that is not of type array....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found