Skip to content

Boolean properties as HTML binary attributes #14761

@rusev

Description

@rusev

I'm submitting a ... (check one with "x")

[ ] bug report => search github for a similar issue or PR before submitting
[x] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Current behavior
Currently when you have a boolean property and bind it to true|false you have to use property binding, i.e

<my-button [rounded]="true"></my-button>

Expected behavior

The following code snippet should set the rounded property to true:

<my-button rounded></my-button>

while the snippet bellow should bind it to false:

<my-button ></my-button>

What is the motivation / use case for changing the behavior?
This mimics the behavior of HTML binary attributes as well as how React threads such properties.

Of course property binding to should still works.

Metadata

Metadata

Assignees

Labels

area: coreIssues related to the framework runtimecore: binding & interpolationIssue related to property/attribute binding or text interpolationcore: inputs / outputsfeatureIssue that requests a new featurefeature: under considerationFeature request for which voting has completed and the request is now under consideration

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions