Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Uncaught (in promise): Error: No provider for CaretEvent! #4

Open
netwrkx opened this issue Jun 18, 2017 · 2 comments
Open

Error: Uncaught (in promise): Error: No provider for CaretEvent! #4

netwrkx opened this issue Jun 18, 2017 · 2 comments

Comments

@netwrkx
Copy link

netwrkx commented Jun 18, 2017

//app.module.ts

import { EmojiPickerModule } from '@ionic-tools/emoji-picker';

  imports: [
    IonicModule.forRoot(MyApp),
    EmojiPickerModule.forRoot(),
  ],
@danielehrhardt
Copy link
Owner

can you setup a small project with this problem i cant reproduce it

@netwrkx
Copy link
Author

netwrkx commented Jun 19, 2017

according to your demo, you imported
import { CaretEvent, EmojiEvent } from "../../../src";

declared it as
private _lastCaretEvent: CaretEvent;

reference it as

handleSelection(event: EmojiEvent) {
  this.content = this.content.slice(0, this._lastCaretEvent.caretOffset) + event.char + 
  this.content.slice(this._lastCaretEvent.caretOffset);
  this.eventMock = JSON.stringify(event);
}

handleCurrentCaret(event: CaretEvent) {
  this._lastCaretEvent = event;
  this.eventPosMock = `{ caretOffset : ${event.caretOffset}, caretRange: Range{...}, textContent: 
  ${event.textContent} }`;
}

CaretEvent, EmojiEvent has no provider in app.module.ts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants