How can I concatenate the below two statements. Both work by oneself.
<app-output [warnMessage]="myvalue | number:'1.0-1'"></app-output>
<app-output [warnMessage]="'TEXT01' | translate"></app-output>
Now I would like to combine both. How can I achieve this? In example something like that:
<app-output [warnMessage]="myvalue | number:'1.0-1' + 'TEXT01' | translate"></app-output>
Property binding in Angular helps you set values for properties of HTML elements or directives. Use property binding to do things such as toggle button functionality, set paths programmatically, and share values between components.
Conclusion. Angular interpolation displays a component property in the view template with double curly braces syntax. Thus, we can show all properties data into view, e.g., string, number, date, arrays, list, or map. Property binding is the technique that will help us bind values to HTML elements' properties.
TypeScript | String concat() Method The concat() is an inbuilt function in TypeScript which is used to add two or more strings and returns a new single string. Syntax: string. concat(string2, string3[, ..., stringN]);
Property binding: Property binding is a one-way mechanism that lets you set the property of a view element. It involves updating the value of a property in the component and binding it to an element in the view template. Property binding uses the [] syntax for data binding.
Try adding some brackets
<app-output [warnMessage]="(myvalue | number:'1.0-1')+('TEXT01' | translate)">
</app-output>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With