I have code in Typescript
(angular 6) in which I for educational reasons, I want to know how to save several message variables with the following data in the cache:
adicionarMensagem(preparacao: PreparacaoDeMensagem) {
let mensagem = {
texto: preparacao.texto,
data: preparacao.data,
contato: preparacao.contato,
souEumesmo: preparacao.contato === this.emissor,
}
This is the function I use to add a message, but I also want to save it in the browser cache.