0
I would like to know if it is necessary to process JSON to use two-way databinding in HTML. I was able to read it without the treatment, but I don’t know if this is the right way.
Follows the code:
ngOnInit() {
this.emissor = 'Luis Henrique';
this._http.get<PreparacaoDeMensagem[]>("../assets/db/mensagem.json")
.subscribe(mensagem => {
this.mensagem = mensagem
for (let i=0;i < mensagem.length;i++){
this.adicionarMensagem(this.mensagem[i]);
}
)}