Comments (2)
Hi @patzick, thanks for the issue.
it has to be called in timeout in angular component so for some small amount of time, when
element is visible, there is no handler for event
Hmm, can You prepare JSFiddle/Plunkr/Codepen for this scenario? Maybe Angular somehow delays rendering? Llike when working with Vue, usually you have to do setTimeout(..., 0)
when you want to deal with DOM.
when the element is hidden, caused by the ng-if action, and showed up then obviously
eventListener stops working too.
It's because ng-if
creates/removes DOM nodes. Try to use ng-show
- it should help as there will always be the same DOM node
To ease working with events maybe create Angular directive which will automatically apply addEventListener
(or Angular's jQuery Lite bind()
or on()
) on element. I've googled some trivial example - http://stackoverflow.com/a/39368223/1616437 or http://jsfiddle.net/Z6RzD/156/ but I don't know if bind()
will work with Custom Events that vue-custom-element
use. If not change that to addEventListener
.
If you will have some other questions feel free to ask them.
Regards!
from vue-custom-element.
If you will have some other questions or request for some more examples feel free to re-open this issue.
from vue-custom-element.
Related Issues (20)
- vue-cli-service build --target lib --name your-component-name src/main.js not working HOT 3
- 【React】custom-element set Object/Array prop in React Hook, the operation result is unstable
- v3.3.0 introduced bug with timing of custom element rendering HOT 1
- Binding does not work on AngularJS with latest version HOT 1
- serve -s dist does not render: "404 the requested path could not be found" HOT 2
- Events within component slots HOT 5
- Use vue-custom-element with vue-class-component and Typescript for Angular HOT 5
- Vue 3 Support HOT 3
- Linking to fonts in shadow dom HOT 3
- [Vuex] How use each store for each custom element HOT 1
- Use vue-custom-element with TypeScript and Router combination HOT 3
- Vue 3 compatability HOT 2
- Gridsome customElement can't be imported
- Vuetify Slider breaks HOT 4
- Doesn't play nice with Decorated Typescript HOT 1
- How do we include vue-custom-element.js file directly in HTML file?
- Working with Buefy in shadow dom HOT 3
- Vuetify2 compatibility? HOT 4
- Vue 3 Support HOT 1
- How to destory component by customelement register?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vue-custom-element.