How to use angular material (https://material.angu

2020-06-09 05:59发布

I remember having seen angular-material.css being used in one of the Angular 2 Demos at ng-conf. Can someone confirm if this works...

Also, is it possible to use the following in Angular 2 Apps:

  • angular-material.js
  • angular-animate.js
  • angular-aria.js

I know that above js have a dependency on Angular 1.3+, but what if I add that dependency over and above my Angular 2 dependency. Will these work then?

2条回答
够拽才男人
2楼-- · 2020-06-09 06:50

No, Angular Material 1.x does not support Angular 2+. You can see some of the issues and discussion around this in issue #6336. Basically, many of the existing, tested components would need to be re-written (many months of work).

material2 only recently (Dec 2016) entered beta and may not be ready for all production applications. If you need Material Design for your Angular 2 app ASAP, then contributing to material2 is your best option.

As far as I know, there is no Material Design library that is production ready (out of beta) for Angular 2+.

I was using Angular2-Polymer with Polymer paper elements to get Material Design in my Angular 2+ applications, but breaking changes in Angular 2.2 have broken that integration and may require a significant re-write of the lib.

Material Components for the Web may someday be another option, but they are in alpha atm.

查看更多
兄弟一词,经得起流年.
3楼-- · 2020-06-09 06:51

So currently you cannot use the current angular material with angular2.

According to Marcy Sutton, they will be addressing incorporation of Angular Material once the team has realeased 1.x.

https://github.com/angular/material2 is the new repo that will be compatible with ng2. There are some forks of Material that may work with ng2 already such as ng2-material.

查看更多
登录 后发表回答