-
-
Notifications
You must be signed in to change notification settings - Fork 96
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
Is there any event to notify when aurelia finished dynamic DOM operation or binding changed? #132
Comments
reply by EisenbergEffect jdanyow on https://gitter.im/Aurelia/Discuss EisenbergEffect jdanyow |
Is this still the case with Aurelia? I am using slick and need to refresh or update slick when a new item is added to its children. This is bound to a VM through the |
You could easily create a custom attribute that you could place on the repeat item template that would fire the event you want. |
But is there ANY best practices in Aurelia to handle such cases? I'm also wondering if it could be just an app architectural case. If we want to do it this way we should create a custom component initializing the dropDown or other kendo control, and then there are no problems at all. What do you think? |
I had this issue today with masonry which applies its layout after the DOM has loaded. As suggested, I just created a custom attribute and attached it to the repeating element:
Then, in the custom attribute
At first seemed a bit odd, but on reflection it's much nicer not to clutter the view model with DOM manipulation stuff which is basically what masonry is doing. |
I use material-design-lite css style in Aurelia.
As description in GETTING STARTED/Use MDL on dynamic websites
Material Design Lite will automatically register and render all elements marked with MDL classes upon page load. However in the case where you are creating DOM elements dynamically you need to register new elements using the upgradeElement function.
code like below,
mdl-js-ripple-effect
in<li repeat.for='i of 10' ><button...
will not work when after click on Add button after page load.mdl-js-ripple-effect
* need to call componentHandler.upgradeElement or componentHandler.upgradeDom()* after<button id='Add'
clicked and aurelia finished dynamic DOM operation .Is there any event to notify when aurelia finished dynamic DOM operation or binding changed?
The text was updated successfully, but these errors were encountered: