Open javiermarinros opened 1 year ago
Hi @javiermarinros, thanks for putting in the time to make this PR.
I think it's an interesting idea and novel. In my opinion though I think it's quite narrow in its use case. A directive to me should be able to be used across a variety of elements, whereas this one can only be used on a textarea. The changes it makes to the textarea is quite substantial as well, giving more support to the idea that it's a full blown component and should look as such in the template it's used. It should also be said that it does add more complexity in having a directive that the component now uses and a whole relationship there that wasn't needed before.
That's my thoughts on it for now. If others think differently or if there's significant want/need for this in the future we'll certainly consider it.
Hi @danoaky-tiny thank you for your review. Just some remarks:
[editor]
attribute, not only textareas.template: '<ng-template></ng-template>'
I separated the
Editor
component logic into a directive and a component that inherits from it.With this change, the directive can be directly attached to a host element like a
textarea
without having to create custom nodes.Example:
It should be compatible with all previous implementations, as the component have the same inputs and outputs as it used to have, and the directive has mostly the same API as the component, except for the
id
andtagName
inputs.