B
B
berch2018-10-04 12:07:38
Angular
berch, 2018-10-04 12:07:38

Angular. Binding html element property to component value?

Found an example on the Angular manual site:
Binding an html element property to a component value (one-way). For example: And if instead of just "name" I need to make a concatenation of the type: 'name-' + var where 'name-' is just a string, and var is a string variable Please tell me how to write this
<input type="text" [value]="name" />

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
Fedor Rychkov, 2018-10-04
@StonedCatt

Do you need one sided?
In the component, in the constructor, you can concatenate your string with a variable, get the string.
https://developer.mozilla.org/en/docs/Web/JavaScript...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question