-
Notifications
You must be signed in to change notification settings - Fork 35
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
Highlight with two-way binding #46
Comments
I am not sure what you are trying to accomplish! you cannot make a code editor with this plugin. you should use or embed a code editor plugin instead. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug Report or Feature Request (mark with an
x
)OS and Version?
Windows 10
Versions
Angular 6.0.0
Desired functionality
Is there any approach to two-way binding for the editors that works consistently? So far, I've implemented a content editable directive to get me part of the way, but having lots of trouble with carriage returns.
Has anyone had any luck doing the same?
Here's a stackblitz link to show how I have it working currently: https://stackblitz.com/edit/ngx-highlightjs-kjqjwf
EDIT: as it stands, I think I have this pretty close. I can write into the field and it'll update the content on the model. I still have some issues though.
On the directive, this function runs when I hit Enter after a space (seems intermittent): highlightTextContent(). When that runs, I find that the cursor jumps back to the top of the editable area (because the content has all totally changed). It's possible I could hook into this function (maybe) and reset the cursor after the redraw, but might need a bit of help getting the right properties exposed....
The text was updated successfully, but these errors were encountered: