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="">

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 the Copy to mine functionality to copy this snippet to your own personal collection and easy manage your code snippets.

Codever is open source on Github ⭐🙏

Subscribe to our newsletter for more code resources and news

Adrian Matei (aka adixchen)

Adrian Matei (aka adixchen)
Life force expressing itself as a coding capable human being

routerLink with query params in Angular html template

routerLink with query params in Angular html template code snippet Continue reading