-
Notifications
You must be signed in to change notification settings - Fork 3.4k
angular material and ngupgrade #6336
Comments
First of all - Great work on the material library. Ability to ng-upgrade current material library would be great ...but i also think that main focus on bringing material to angular2 would result in much better performance and overall simpler conversion process. |
+1 |
1 similar comment
+1 |
Not sure if this helps, but could $provide.decorator be used to wrap the directives so the names stay the same? I've used it to wrap existing directives before in Angular1 Just starting to experiment with both Angular2 and Material so maybe way off ... |
+1 |
+1 |
2 similar comments
+1 |
+1 |
So the main issue is that ngUpgrade does not actually upgrade directives that don't have an isolate scope. It seems that this might be a problem for many other directives out there. Like angular-file-upload. I would first ask if there really is not straight-forward way to wrap these kinds of directives or if all of them can be rewritten to use isolate scope. If the latter is the case then I'm thinking this is what the Angular Material team might already be doing for v2. Regardless, if this issue isn't fixed somehow, I think Angular Material itself can become one of the biggest reasons for me and all the others who actively use this library to stay away from upgrading to Angular 2. As most Angular directives are just wrappers for other bigger JS libraries or at least some similar JS library available, this library might be one of the hardest to just replace imo. Hopefully someone from the core Angular Material team or someone else can chime in on what to expect or how we could solve this issue ourselves. At least nice to see that @jelbourn added a high priority tag to this issue. |
+1 |
+1 |
+1 Not having Material support is the single biggest reason I can not use angular 2. |
This is an implementation of Material Design components for Angular 2 |
+1 |
1 similar comment
+1 |
I whipped up this quick POC to see exactly what does and does not work: http://plnkr.co/edit/Wx897WH38ZVHRufrt5go?p=preview As of writing this, it generates 208 specs from all found directives, services and factories of which 172 are failing to upgrade. This could very well need some tweaking, I was just trying to get a quick high-level picture of the current state. |
cc @mhevery |
To be investigated/researched AFTER Layouts Gen2. |
+1 |
+1 |
2 similar comments
+1 |
+1 |
Well I actually just browsed through the source code of the directives. That and looking at the plunker @jardilio made it seems to me that so many directives use either compile, have no template, or use replace that the effort that goes into making these directives/services compatible with the ngUpgrade library would be better spend on getting the Angular2 version of ngMaterial done. |
Hi @ThomasBurleson, Thanks, |
+1. Some directives, e.g. |
Hi @ThomasBurleson , I guess that this issue can be closed . Is this correct? Thanks, |
Sorry, but someone can use ngMaterial (1) with Angular2? A small Recipe wil be great :P :) |
Then, to make it clear, it is not possible to use ngMaterial + ngupgrade in angular2 Thanks @Splaktar! |
No its not. :)
…On Fri, Dec 30, 2016, 13:43 Pablo Reyes ***@***.***> wrote:
Then, to make it clear, it is not possible to use ngMaterial + ngupgrade
in angular2
Thanks @Splaktar <https://github.com/Splaktar>!
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#6336 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AKfRT6S8enQbsyQ9VkHqAk3WNVh8pJl6ks5rNPxkgaJpZM4G2UWt>
.
|
Most part of ngMaterial ( 1 ) directives in their DDO uses link. |
Any updates? |
As angular material is the leading ui library created by google, and angular2, the next generation of angular is now in beta it is important to be able to work with both of them.
There is the excellent ngupgrade library.
I tried to upgrade the angular material components with the function: adapter.upgradeNg1Component()
These are the results.
The following fail:
The following work:
When trying to upgrade the providers with adapter.upgradeNg1Provider():
All work (at least just upgrading)
*$mdBottomSheet
I see a possible ways to fix this:
(This is a rough idea not code that runs)
This has the downside that the name of the directives are different than the original ones, and attribute directives are not covered.
So I don't see any 100% solution.
Getting an angular material 2 wouldbe a good solution when it comes out together with angular2 :-)
I am sure you will find a smart solution here 👍
The text was updated successfully, but these errors were encountered: