angular property binding
// component.ts
@Component({
templateUrl: 'component.html',
selector: 'app-component',
})
export class Component {
name = 'Peter';
updateName() {
this.name = 'John';
}
}
// component.html
<p>My name is {{name}}</p>
<button (click)="updateName()">Update button</button>
import { Component } from "@angular/core";
@Component({
selector: 'app-example',
template: `
<div>
<input [value]='myText'></span>
</div>
`
})
export class AppComponent {
myText: string = "Hello World";
}
Also in HTML:
- how to put an image in html
- search/find content ftp html
- ionic grid
- html ul types
- html import jquery
- HTML Image full screen width
- html href to gmail
- m3u8 ffmpeg download
- html input label
- 400 (Authentication information is not given in the correct format. Check the value of Authorization header.)
- html image center
- how to align text beside image in html
- how to insert degree symbol in html
- how to customize link text in html
- html image
- html center text
- html background image
- hyperlink html
- how to click and copy in html button using javascript
- how to use icon in html
- add an anchor tag onclick
- set default value of a multiselect in html
- how to insert background image in html
- svg circle