Git Product home page Git Product logo

Comments (19)

jadjoubran avatar jadjoubran commented on August 18, 2024 1

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

from angular-material-design-lite.

jadjoubran avatar jadjoubran commented on August 18, 2024

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?

from angular-material-design-lite.

Piou2fois avatar Piou2fois commented on August 18, 2024

Yeah you can get there
http://plnkr.co/edit/cocnTVF1g2mqziy89nL0?p=preview
And remove on the groups.html template to see the problem, this is a simple way I found with icebox on IRC to get the function launched.
The other system can be found there (solution made by Jimlei) : http://plnkr.co/edit/q14LPr34tUELd3lDCywE?p=preview
It is using a directive with function as parameter (any function, idea is to use the component....

from angular-material-design-lite.

jadjoubran avatar jadjoubran commented on August 18, 2024

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!

from angular-material-design-lite.

Piou2fois avatar Piou2fois commented on August 18, 2024

http://plnkr.co/edit/MUI2iBslIH9jd4fgEQPL?p=preview
I made 2 templates, one is working with the ngIf the other one not (the style of the textfield is not "rippled" )

from angular-material-design-lite.

Piou2fois avatar Piou2fois commented on August 18, 2024

Don't forget I did not used your directive yet, but I imagine you will have the same issue

from angular-material-design-lite.

jadjoubran avatar jadjoubran commented on August 18, 2024

Thank you very much!

The solution would be to use the componentHandler.upgradeElement() method on the linking phase of the directive just like MDL suggests on their website: http://www.getmdl.io/started/index.html#dynamic

Working on a fix

from angular-material-design-lite.

Piou2fois avatar Piou2fois commented on August 18, 2024

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.

from angular-material-design-lite.

jadjoubran avatar jadjoubran commented on August 18, 2024

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

from angular-material-design-lite.

Piou2fois avatar Piou2fois commented on August 18, 2024

hacking is not a solution I think.

from angular-material-design-lite.

jadjoubran avatar jadjoubran commented on August 18, 2024

True.

Okay just noticed that they released 1.0.1. I should upgrade and see if it makes a difference.

from angular-material-design-lite.

jadjoubran avatar jadjoubran commented on August 18, 2024

Great at least now I can write upgradeElement(el) without specifying its type: MaterialButton, etc..
So I still have the issue with the ripples.. And the issue is still open google/material-design-lite#804
So I'm subscribed and I'll fix it as soon as it's possible

from angular-material-design-lite.

jadjoubran avatar jadjoubran commented on August 18, 2024

Actually I just noticed that the problem seems to be because the element was already upgraded..

from angular-material-design-lite.

jadjoubran avatar jadjoubran commented on August 18, 2024

Unfortunately, we have to wait for the open issue.
Thanks again for contributing and don't forget to star the project!

from angular-material-design-lite.

jadjoubran avatar jadjoubran commented on August 18, 2024

Hey @Piou2fois

I just pushed the mdl-upgrade attribute directive as a temporary solition. Check out the docs and let me know if it works for you!

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.

from angular-material-design-lite.

Piou2fois avatar Piou2fois commented on August 18, 2024

Great. I am going to update my project using your directives (switched to lumx as branch, will create a new branch with angularMDL)

from angular-material-design-lite.

jadjoubran avatar jadjoubran commented on August 18, 2024

Great! Let me know how it goes.. So the new directives are working as expected?

from angular-material-design-lite.

Piou2fois avatar Piou2fois commented on August 18, 2024

Did not try yet, this afternoon I will give a try and let you know

from angular-material-design-lite.

jadjoubran avatar jadjoubran commented on August 18, 2024

Closing this for now, feel free to re-open

from angular-material-design-lite.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.