Sorry for this silly question!
I found this binding as:
<ng-template [ngxPermissionsExcept]="['JOHNY']">
....
</ng-template>
This other:
<mat-list-item [routerLink]="[child.route]">
A Partner told me that I need to use Square Brackets in order to avoid that Style:
[formControlName]="component.name"
[placeholder]="component.label"
Here isn't The angular brackets [] () {} what they bind and when to use which
What is the name for this assignation style: ="[...]">?
When is necessary to use it?
CodePudding user response:
{{expression}} (type: Interpolation) and [target]="expression" (type: Property Attribute) are One-way Data Direction from data source to view target.
(target)="statement" (type: Event) is One-way Data Direction from view target to data source.
[(target)]="expression" (type: Two-way) is Two-way Data Direction
CodePudding user response:
The square bracket notation like [...]="[...]" is used when the corresponding @Input() definition accepts an array type as argument.
In your case
[routerLink]="[child.route]"- The corresponding
@Input()definition accepts arguments of typeany[]|string|null|undefinedand your specific usage is of typeany[]. - You can refer here for a more extended use case of
[routerLink]binding.
- The corresponding
[ngxPermissionsExcept]="['JOHNY']"- The corresponding
@Input()definition accepts arguments of typeString | String[]and your specific usage is of typeString[]. - You can refer here for other use cases of
[ngxPermissionsExcept]binding.
- The corresponding
