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.

self.context.onReady is not a function and self.context.onChange is not a function

See original GitHub issue

I’m getting self.context.onReady is not a function and self.context.onChange is not a function

Any ideas?

Use is:

<ckeditor
    [(ngModel)]="model.body"
    [config]="{uiColor: '#99000'}"
    (change)="onChange($event)"
    (ready)="onReady($event)"
    debounce="500" name="body">
</ckeditor>

Exception is:

zone.js:140 Uncaught EXCEPTION: Error in ./BlogPostFormComponent class BlogPostFormComponent - inline template:56:3
ORIGINAL EXCEPTION: TypeError: self.context.onReady is not a function
ORIGINAL STACKTRACE:
TypeError: self.context.onReady is not a function
    at DebugAppView._View_BlogPostFormComponent0._handle_ready_53_2 (BlogPostFormComponent.ngfactory.js:1039:28)
    at eval (http://localhost:8045/jspm_packages/npm/@angular/core@2.0.0-rc.5/src/linker/view.js:381:24)
    at SafeSubscriber.schedulerFn [as _next] (http://localhost:8045/jspm_packages/npm/@angular/core@2.0.0-rc.5/src/facade/async.js:102:54)
    at SafeSubscriber.__tryOrUnsub (http://localhost:8045/jspm_packages/npm/rxjs@5.0.0-beta.6/Subscriber.js:225:16)
    at SafeSubscriber.next (http://localhost:8045/jspm_packages/npm/rxjs@5.0.0-beta.6/Subscriber.js:174:22)
    at Subscriber._next (http://localhost:8045/jspm_packages/npm/rxjs@5.0.0-beta.6/Subscriber.js:124:26)
    at Subscriber.next (http://localhost:8045/jspm_packages/npm/rxjs@5.0.0-beta.6/Subscriber.js:88:18)
    at EventEmitter.Subject._finalNext (http://localhost:8045/jspm_packages/npm/rxjs@5.0.0-beta.6/Subject.js:128:30)
    at EventEmitter.Subject._next (http://localhost:8045/jspm_packages/npm/rxjs@5.0.0-beta.6/Subject.js:120:18)
    at EventEmitter.Subject.next (http://localhost:8045/jspm_packages/npm/rxjs@5.0.0-beta.6/Subject.js:77:14)
ERROR CONTEXT:
[object Object]Zone.runTask @ zone.js:140ZoneTask.invoke @ zone.js:304
zone.js:140 Uncaught EXCEPTION: Error in ./BlogPostFormComponent class BlogPostFormComponent - inline template:55:3
ORIGINAL EXCEPTION: TypeError: self.context.onChange is not a function
ORIGINAL STACKTRACE:
TypeError: self.context.onChange is not a function
    at DebugAppView._View_BlogPostFormComponent0._handle_change_53_1 (BlogPostFormComponent.ngfactory.js:1032:28)
    at eval (http://localhost:8045/jspm_packages/npm/@angular/core@2.0.0-rc.5/src/linker/view.js:381:24)
    at SafeSubscriber.schedulerFn [as _next] (http://localhost:8045/jspm_packages/npm/@angular/core@2.0.0-rc.5/src/facade/async.js:102:54)
    at SafeSubscriber.__tryOrUnsub (http://localhost:8045/jspm_packages/npm/rxjs@5.0.0-beta.6/Subscriber.js:225:16)
    at SafeSubscriber.next (http://localhost:8045/jspm_packages/npm/rxjs@5.0.0-beta.6/Subscriber.js:174:22)
    at Subscriber._next (http://localhost:8045/jspm_packages/npm/rxjs@5.0.0-beta.6/Subscriber.js:124:26)
    at Subscriber.next (http://localhost:8045/jspm_packages/npm/rxjs@5.0.0-beta.6/Subscriber.js:88:18)
    at EventEmitter.Subject._finalNext (http://localhost:8045/jspm_packages/npm/rxjs@5.0.0-beta.6/Subject.js:128:30)
    at EventEmitter.Subject._next (http://localhost:8045/jspm_packages/npm/rxjs@5.0.0-beta.6/Subject.js:120:18)
    at EventEmitter.Subject.next (http://localhost:8045/jspm_packages/npm/rxjs@5.0.0-beta.6/Subject.js:77:14)
ERROR CONTEXT:
[object Object]

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
7Hdcommented, Oct 3, 2016

If use:

<ckeditor
    [(ngModel)]="model.body"
    [config]="{uiColor: '#99000'}"
    (change)="onChange($event)"
    (ready)="onReady($event)"
    debounce="500" name="body">
</ckeditor>

then, you need add onChange() and onReady() to your component, just like model.body for ngModel

class YourComponent {
  // ...
  onChange() { }
  onReady() { }
}
0reactions
chymzcommented, Oct 10, 2016

thanks @7Hd !

Read more comments on GitHub >

github_iconTop Results From Across the Web

self.context is not a function - angular - Stack Overflow
I am trying to call this function domain from my template but getting self.context.article.domain is not a function error.
Read more >
Uncaught TypeError | Is Not A Function | Solution - YouTube
Have you encountered an error like:- Uncaught TypeError- Some selector is not a function - jQuery is not a function - owlCarousel is...
Read more >
Context Managers and Python's with Statement
In this step-by-step tutorial, you'll learn what the Python with statement is and how to use it with existing context managers.
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 >
Management API — PyTorch/Serve master documentation
TorchServe will not run inference until there is at least one work assigned. ... def handle(self, data, context): """Entry point for default handler....
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