An Interest In:
Web News this Week
- April 2, 2024
- April 1, 2024
- March 31, 2024
- March 30, 2024
- March 29, 2024
- March 28, 2024
- March 27, 2024
January 11, 2023 10:10 am GMT
Original Link: https://dev.to/codever/how-to-set-value-of-input-field-in-angular-template-4j6e
How to set value of input field in angular template
To set the initial value of the input
control, just use the value
attribute:
<input type="text" class="form-control" placeholder="Generate Codever sharable Url" aria-describedby="basic-addon2"value="{{ environment.HOST + '/bookmarks/shared/' + shareableId}}">
Project: codever
- File: social-share-dialog.component.html
To understand usage of angular environment used in this snippet (environment.HOST
)
see the Configure and use environment specific values in Angular and html template snippet
Reference -
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input
Shared with from Codever. Use copy to mine functionality to add it to your personal snippets collection.
Codever is open source on Github
Original Link: https://dev.to/codever/how-to-set-value-of-input-field-in-angular-template-4j6e
Share this article:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To