Add editor HTML element to plugin bindings
See original GitHub issue@stevermeister what do you think about passing the HTML element that hosts the editor in the bindings property of ngWigPlugin? In that way, we could overcome difficulties that appear when using multiple editors in a template and simplify the way to find in which editor the plugin belongs to.
For example, in clear-styles plugin, we use the following to find the actual editor element:
var ngWigElement = e.target.parentElement.parentElement.parentElement.parentElement.parentElement;
var container = angular.element(ngWigElement.querySelector('#ng-wig-editable'));
which is really error prone and difficult to read and test. It could be changed to something like:
var container = angular.element(this.hostElement);
Issue Analytics
- State:
- Created 7 years ago
- Comments:11 (11 by maintainers)
Top Results From Across the Web
Event binding on dynamically created elements?
The problem I have is that any select boxes I add via Ajax or DOM after the initial loop won't have the event...
Read more >Binding HTML to a Page Elements in Creatio (formerly bpm ...
First of all, one thing to mention, if you want the bound HTML to be editable, you can simply bind the property containing...
Read more >The "html" binding - Knockout.js
The html binding causes the associated DOM element to display the HTML specified by your parameter. Typically this is useful when values in...
Read more >lit-plugin - Visual Studio Marketplace
Extension for Visual Studio Code - Syntax highlighting, type checking and code completion for lit-html.
Read more >Adding custom code in the Builder.io visual editor
The Builder editor allows you to add event handlers, bind to state and even add custom JavaScript that will run on your page....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I really like your approach. Never thought of it! It is also much more testable. I will make the change and submit a PR for that. Thanks!