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.

TypeError: this._onChangeCallback 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
[] support request/question

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

Current behavior I’m trying to use ngx to implement the tag systems. When entering the page everything happens as expected and no error is noticed on the console.

But when I do some kind of action, adding a new tag, editing, deleting or something with my tag-input field, the following error appears in the console:

ERROR TypeError: this._onChangeCallback is not a function at TagInputComponent.set [as items] (ngx-chips.bundle.js:2823) at TagInputComponent._this.appendTag (ngx-chips.bundle.js:1909) at SafeSubscriber.subscribeFn [as _next] (ngx-chips.bundle.js:2186) at SafeSubscriber.__tryOrSetError (ngx-chips.bundle.js:568) at SafeSubscriber.next (ngx-chips.bundle.js:510) at Subscriber._next (ngx-chips.bundle.js:448) at Subscriber.next (ngx-chips.bundle.js:412) at FilterSubscriber._next (ngx-chips.bundle.js:3807) at FilterSubscriber.Subscriber.next (ngx-chips.bundle.js:412) at MapSubscriber._next (ngx-chips.bundle.js:4059)

Expected behavior The expectation is that it works without throwing an error on the console.

Minimal reproduction of the problem with instructions (if applicable) 1. Added to tag to line.component.html <tag-input [(ngModel)]='items' [editable]='true'></tag-input> 2. Import TagInputModule in my register.module.ts import { TagInputModule } from 'ngx-chips'; 3. Import BrowserAnimationsModule in my app.module.ts imports: [ CommonModule, BrowserAnimationsModule, HttpModule, FormsModule, AppRoutingModule, BsDropdownModule.forRoot(), TabsModule.forRoot(), ChartsModule ]

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

Angular version: @angular/cli: 1.2.0, node: 6.11.1, os: linux x64, @angular/animations: 4.3.3, @angular/common: 4.2.5, @angular/compiler: 4.2.5, @angular/core: 4.2.5, @angular/forms: 4.2.5, @angular/http: 4.2.5, @angular/platform-browser: 4.2.5, @angular/platform-browser-dynamic: 4.2.5, @angular/router: 4.2.5, @angular/upgrade: 4.2.5, @angular/cli: 1.2.0, @angular/compiler-cli: 4.2.5

ngx-chips version: version 1.5.0

Browser: [Chrome]

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:31 (15 by maintainers)

github_iconTop GitHub Comments

3reactions
Gbuompriscocommented, Aug 10, 2017

@renanmoraes Add the operator “first” in the same way you imported those ones

import 'rxjs/add/operator/first';

and you should not be pushing to items, ngModel takes care of that. onAdding will just replace the value that will be added

2reactions
Gbuompriscocommented, Feb 19, 2019

Are you defining any model? That’s what that error usually say. Either no ngmodel or no form control name. Check the examples

Read more comments on GitHub >

github_iconTop Results From Across the Web

What is the reason for "ERROR TypeError: this.onChange is ...
While the type of onChange is a function, I don't see anything actually setting the value, it is undefined (hence, not a function)....
Read more >
How to Handle JavaScript Uncaught TypeError: “x” is Not a ...
The Javascript TypeError: "x" is not a function occurs when calling a function on a value or object, which is not actually a...
Read more >
Angular 2: Connect your custom control to ngModel with ...
These are functions we have to implement from the ControlValueAccessor interface and these are the functions we need to use internally to communicate...
Read more >
problems with component using ControlValueAccessor #14627
Problems: Canvas Tab: throwing error: ERROR TypeError: instance.registerOnChange is not a function (in legacy renderer); throwing error ...
Read more >
ControlValueAccessor - Angular
Registers a callback function that is called by the forms API on initialization to update the form model on blur. registerOnTouched(fn: any): ...
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