Components: Support [hidden] on buttons

Created on 8 May 2017  路  5Comments  路  Source: angular/components

Bug, feature request, or proposal:

Feature Request

What is the expected behavior?

hidden selector should hide a button if the value is true.

What is the use-case or motivation for changing an existing behavior?

I am making a wizard using material design, and i need to hide my next button when I reach the last step.

Which versions of Angular, Material, OS, browsers are affected?

"@angular/material": "git+https://github.com/angular/material2-builds.git"
"@angular/core": "^4.0.0",

Most helpful comment

Why not use <button *ngIf="isLastStepCondition"></button>?

All 5 comments

Why not use <button *ngIf="isLastStepCondition"></button>?

Oh wow... yeah, that will work. I was moving someone else's code around to a newer version and it wasn't working... I ended up wrapping it in a span using the hidden tag, but yeah, that ng-if would work.

The only thing I can think of is if you wanted it to be on the dom without showing it, but this doesn't bother me at the moment.

You can hide with CSS using ngStyle or ngClass.

Closing as hidden is not a attribute on HTML spec <button>.

As mentioned hiding can be done with *ngIf or css styling.

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dzrust picture dzrust  路  3Comments

vitaly-t picture vitaly-t  路  3Comments

LoganDupont picture LoganDupont  路  3Comments

xtianus79 picture xtianus79  路  3Comments

julianobrasil picture julianobrasil  路  3Comments