Skip to content

Editor name not taken from component ID #250

@SpencerGresoro

Description

@SpencerGresoro

I was expecting if the component has an id/template id -- ckeditor id="letterEditor" #letterEditor -- that when createEditor is called, it would take the value of the id attribute, and use that as the instance name.

Would it be possible to extend ckeditor4-angular.mjs to include a 'id' property as well as 'tag'
If we could just pass a node instead of a tagName, that would also solve the issue.

I need this for various reasons, not least of which is context detection and grabbing the correct editor instance. The fact that it doesnt derive the editor name from the original node (in this case component) id, creates a snowball effect of breakage.
It creates editor1, editor2..ect.
I also noted that when navigating away to a new route, and coming back, it keeps incrementing this generated name. So an editor2 becomes editor3, and so on... with each nav away and back. Id like to stop that from happing as well.

Any suggestions much appreciated.
I'm not sure what the best approach it, I just created a new @input property 'editorName' - and if that's not null, set that as the ID of the <textarea> or other node you create.

I went ahead and forked this repo and made the change, but frankly Its alot of guess work. My goal was to create a new package with my forked version, but I cant seem to publish to npm.. very likely because I've never created packages before ! :) So despite making the change, I cant seem to publish it for our project to link to instead of the official one.

Thank you in advanced.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions