-
Notifications
You must be signed in to change notification settings - Fork 38
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
componentHandler.upgradeAllRegistered() on ngView #4
Comments
Hi @Piou2fois Thank you for contributing to angular-material-design-lite! This indeed a great idea that's very common in dynamic website. I'm very interested in having a solution that works for all scenarios.. the problem with the scenario is that it only works for your scenario. I can help you create a fix for your specific scenario and then we can maybe work on a fix for most scenarios. So can you please provide a working plnkr of your issue? |
Yeah you can get there |
I'm sorry but I couldn't reproduce the issue.. I'm probably missing something. Can you please provide me with 2 plnkrs, one of them containing the issue and the other one fixed? Also please try to make it as brief as possible so I can focus on the issue we're trying to solve. Thanks again! |
http://plnkr.co/edit/MUI2iBslIH9jd4fgEQPL?p=preview |
Don't forget I did not used your directive yet, but I imagine you will have the same issue |
Thank you very much! The solution would be to use the Working on a fix |
I had to do it inside the compile instead of the link (because the element has to be in the Dom to be upgraded). So it worked on the mdl-text-field I'm now working on the other elements and updating the documentation |
That's in fact the problem, elements have to be in the DOM to be updated. Don't master yet the directive system so can't help you with that, but if you found the solution that's perfect, tou can now reach a full working MDL system. |
Yeah I'm having some other issues now with the Checkbox and I'm seeing some of these issues are already open on MDL's repository.. So I might have to postpone it or go with a temporary solution just like you suggested (an attribute directive that fires only at the end).. but it feels like a hack |
hacking is not a solution I think. |
True. Okay just noticed that they released 1.0.1. I should upgrade and see if it makes a difference. |
Great at least now I can write |
Actually I just noticed that the problem seems to be because the element was already upgraded.. |
Unfortunately, we have to wait for the open issue. |
Hey @Piou2fois I just pushed the It's a very lightweight solution since it only upgrades the MDL component itself (upgradeElements instead of upgradeAllRegistered) and you only add it on the required elements. |
Great. I am going to update my project using your directives (switched to lumx as branch, will create a new branch with angularMDL) |
Great! Let me know how it goes.. So the new directives are working as expected? |
Did not try yet, this afternoon I will give a try and let you know |
Closing this for now, feel free to re-open |
Hi
I am facing an issue using MDL with Angularjs in the ngView
For example on Textfields, the ripple.js is launched before the end of the ng-repeat process into the ngView. It is recommended to launch the function componentHandler.upgradeAllRegistered() when all is finished on dynamic websites but can't find anyway for that.
Best way seems to have a directive linked to the "$last" of ngRepeat elements :
Perhaps you can add this directive in all the MDL directives ?
The text was updated successfully, but these errors were encountered: