英文:
Angular : show value without update
问题
<span>{{value}}</span>,但在值更改时不更新此 span
英文:
I want to show value of variable with initial status. I dont want to show update when value is changed
<span>{{value}}</span>
Something like this, but without updating this span when value is changed
答案1
得分: 1
.ts文件:
valueThatWontChange: any
ngOnInit() {
this.valueThatWontChange = this.value
}
.html文件:
{{ this.valueThatWontChange }}
英文:
.ts:
valueThatWontChange: any
ngOnInit() {
this.valueThatWontChange = this.value
}
.html:
{{ this.valueThatWontChange }}
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论