r/angularjs • • Feb 20 '16

Why you shouldn’t use Angular Material today

https://medium.com/@vayvala/why-you-shouldn-t-use-angular-material-4ffb937ef232#.22lx4ult9
8 Upvotes

28 comments sorted by

10

u/chazzlabs Feb 20 '16

I'm a little confused about the author's list of features not included in Angular Material. Things like the side menu actually do exist in the library, and some of the things he includes in the list of missing items (eg, button groups and two-sided sliders) don't exist in the Google Material design spec to begin with so it would make sense that Angular Material doesn't have them.

4

u/postmodest Feb 20 '16

I'm not using Angular Material today because it's not ready for prime time in several major browsers.

1

u/vayvala Feb 20 '16 edited Feb 20 '16

You're right about range slider, but it's still nice to have one. Yes, side menu does exist but "menu" component doesn't. In order to make a responsive menu with Angular Material, you need to build a horizontal menu that will collapse when screen size is small enough. Then you would need to create a side menu (provided to you by Angular Material) that should open only when you swipe right or click on the menu button on your phone. Menu is commonly used component and you don't expect to handle all this logic by yourself when you're using library this big.

2

u/chazzlabs Feb 20 '16

As far as I'm aware, a responsive menu like you're describing isn't defined in the Google Material spec. Given that, I wouldn't expect to find it in Angular Material.

3

u/krlkv Feb 21 '16 edited Feb 21 '16

Material spec is a design spec. It has some basic components as basic building blocks, but it doesn't mean that its implementations have to limit themselves to these basic components only. Nothing prevents these implementations from building more complete and useful components as long as they stick to material design guidelines.

Besides, Angular Material already has some components like Sidenav, which are not strictly defined in Material spec (there is no component named Sidenav in Material spec).

Nothing prevents something like Materialize "Navbar with Mobile Collapse Button" or Bootstrap "Navbar" implemented in Angular Material.

Finally coming back to practical point of view, if I want to move from ui-bootsrap, I don't want to spend my time re-implementing responsive Navbar, just because it's a not a part of the spec. Responsive Navbar with collapse button is a part of almost every page. It must exist as a single configurable component.

1

u/TheNiXXeD Feb 21 '16

They have a sidebar. What exactly doesn't it do that you need?

1

u/krlkv Feb 21 '16

Sidenav you mean? It's just a part needed for full responsive navbar component, not a complete thing.

1

u/TheNiXXeD Feb 21 '16

I have a site in production using a side nav with full menu. It was fairly trivial even. It's secured otherwise I'd show you a link here.

0

u/krlkv Feb 21 '16

This doesn't change my point that Angular Material team should add complete responsive navbar component.

They are not strictly adhering to Angular Material components anyway.

1

u/BoleroDan Feb 22 '16 edited Feb 22 '16

Hold on a second, are you referencing this component

http://materializecss.com/navbar.html

from materialize as your responsive navbar?

Because if so, this is literally just using common classes and screen size states to hide or show elements. There is literally nothing special about this and while Angular Material doesnt "directly" give you an example of a "responsive nav" you can absolutely do this with all of the components available. Part of being a web developer is using the tools you have, to create things you need and luckily AngularMaterial has all of these covered for this use case.

For example. Use the Angular Material "toolbar"component for the "base" of your nav. Use some <md-buttons> for your links. Need to position them? Use the flex box method or what ever method you want.

Use the various css classes that hide and show elements, based on screen size, exactly how Materialize does this. There is no difference between ".hide-gt-xs" and Materializes ".hide-on-med-and-down".

If need be, someone can issue a git pull request and add a "documented use case" as a "nav bar" as an example. (But most of this is covered under the toolbar component page, besides the hiding of elements based on screen size) All of the tools are literally there, and take the exact amount of time to construct compared to materialize.

Quote from the article

"Currently, there is no navbar component in Angular Material. I had to build horizontal menu, side menu and take care of all responsive logic myself."

You literally have to do this yourself as well in the materialize component. It's just re using common CSS classes just as a I described above, except they have an exact, specific use case in their documents. Looking at the "Mobile Collapse Button" on the navbar section of materializecss -- is that not doing all of the responsive logic yourself as well? (Creath the html structure, add their responsive classes) Are you kidding me? You have to build that html, and add in their responsive CSS classes "button-collapse, hide-on-med-and-down" literally as you need to when using Angular Material. You're making this sound like Materializecss is literally just "<responisve-nav-menu></responsive-nav-menu>"

1

u/krlkv Feb 22 '16 edited Feb 22 '16

No, I'm not kidding. Bootstrap had responsive navbar for years. Now we have Angular Material and you have to "build it yourself".

If Angular Material team thinks it shouldn't be a single component, there should be a clear guide with best practices and code examples on how to implement navigation drawer pattern of the Material Spec using available Angular Material components, as it was done for ages for Bootstrap navbar.

1

u/BoleroDan Feb 22 '16

Now we have Angular Material and you have to "build it yourself".

Hold on hold on hold on.

Build it your self? You mean, literally just using TWO css classes to hide and display elements depending on screen size? I hardly even call this a "component" This is literally just html and css. As a web developer, what the heck are you doing except "building things"

There is literally, no difference between their "responsive nav" and the toolbar and layout/css helper class examples. Granted, yes, they do not have an example usage of a responsive nav with their toolbar, I will give you that. But you know what the first thing I did with Angular Material? Was build a responsive nav.

build it your self... yeah uh thats what you have to do, define elements and attach CSS classes, it's just in this case, someone ahs done most, if not all of the work for you.

The best thing about this, is it is incredibly trivial, even for someone like you, to simply add an example "Responsive Nav" to their toolbar component documentation. All you have to do, is issue a pull request. How much work do you have to do? Copy their previous toolbar html example.. add in a "hamberger button for mobile".. append your CSS classes to hide and display elements responsively. Done.

1

u/vayvala Feb 22 '16

The main problem is not with responsive logic it's with side-bar. To not be confused by Materialize, let's take Bootstrap as an example. On mobile devices, Bootstrap shows all links in a drop-down and you don't need to duplicate them. If you want to make a responsive navbar using Angular Material, you need to create a side-bar, duplicate all the links and make sure that it opens when you click on the menu button or swipe right.

1

u/BoleroDan Feb 22 '16

Ah this is the Author, the OP was not doing a good job explaining, your reply explains the issue at hand better (more so than even the article.. I dunno, heh..). One could argue if you are using "Angular" and are duplicating all your links in this scenario, you can most likely achieve this using Angular in a much better way. While this can be done purely in CSS, it is fairly trivial to architect in Angular to achieve no duplication of links between a sidebar controller, or your nav controller. I've done this in the past with other libraries/frameworks.

1

u/BoleroDan Feb 22 '16 edited Feb 22 '16

First are you the Author? I'm confused on the authors examples of the "responsive nav menu"

The author shows two examples.. I'm ASSUMING, the first animated example is of AngularMaterial ? The second being materialize? The Materialize example (the pinkish looking example) just shows a side nav that comes out, that literally angular material has, so I know what you're trying to say here, but the examples shown are confusing me because they both look the same (Both have a side menu that comes out)

1

u/krlkv Feb 22 '16

No, I'm not. vayvala is.

-1

u/krlkv Feb 21 '16

Material Design spec and Angular Material are not 1 to 1 match in terms of components, so the argument that Angular Material shouldn't have something because it's not Material Design spec is flawed.

1

u/mrv1234 Feb 21 '16

I also had this impression about the material design components for version 1, they just don’t have the same level of support as the framework itself.

But I think some of the components listed as missing are really missing by design:

  • Pagination

  • Breadcrumbs

  • Data Table

Because these are somewhat mobile UI anti-patterns. There is just not enough physical space for data tables in mobile. Even a retina tablet in landscape mode has so much physical horizontal space available.

For many tables it would still work if its mostly numbers, but people would start adding description fields with long text that would wrap up and create a bad user experience.And this simply does not work in table landscape mode, let alone on a phone.

The mobile pattern that works well is lists of items with infinite scrolling and a master detail navigation when you click the items that replaces the full screen, and not paginated data tables.

Also breadcrumbs would quickly wrap up on a phone and look awful on screen. Also they consume precious screen space on a phone table.

Some of these are simply desktop UI patterns that cannot be made to work on mobile, and thats the reason they are absent.

1

u/krlkv Feb 21 '16 edited Feb 21 '16

Data table is not missed by design as it is a Material Design component: https://www.google.com/design/spec/components/data-tables.html

Besides Material Design is not for mobile only. Not even mentioning Angular Material implementation, which is probably overwhelmingly used for Web development, not mobile.

Develop a single underlying system that allows for a unified experience across platforms and device sizes. Mobile precepts are fundamental, but touch, voice, mouse, and keyboard are all first-class input methods.

2

u/its_time_to_get_ill Feb 21 '16

https://github.com/daniel-nagy/md-data-table

an excellent plugin that I imagine will eventually be adopted

1

u/krlkv Feb 22 '16

Looks nice. Do you know if it supports line by line editing out of the box? Similar to http://ng-table.com/#/editing/demo-inline

1

u/AlGoreBestGore Feb 21 '16

Size is definitely a concern, but the "too many GitHub issues" is just dumb. Every large project is going to have a shitload of issues.

1

u/krlkv Feb 22 '16

Not dumb at all. angular-ui 109 open, 3490 closed. Angular Material 1474 open, 4370 closed. That's definitely a concern. Lost of unfixed bugs.

1

u/AlGoreBestGore Feb 22 '16

That could very well be a bunch of people with random feature requests that don't match the Material design spec. E.g. I have a module that's named literally "round progressbar" and every few months there's somebody that asks whether I can make it also do straight progressbars.

3

u/krlkv Feb 22 '16

If they are, they can / should be closed promptly, but they are not.

1

u/BoleroDan Feb 22 '16

Exactly. I use angular material for my very very very large in house Lab management software. It works fine in the latest firefox/chrome that i've tested, havnt found any game breaking issues.

That being said, i go through the issue lists a lot on this project and a lot of them are indeed, silly questions on how to use a component, and not necessarily an issue such as a bug.

Infact, I would argue that the more active the issues section on a github repo is actually better. This means to me, that the community is active, and I actually see a lot of the developers responding to issues. An empty issues tab on github makes me skeptical of using a piece of software.

1

u/Xerxero Feb 20 '16

The size is a concert.

0

u/[deleted] Feb 21 '16

[deleted]

1

u/krlkv Feb 22 '16

Somebody who was defending Angular Material gave me a link to their Angular Material Web app a couple of days ago and it actually had flicker and animations lag using Firefox 44 on i7 CPU