0
I have a code in Typescript (angular 6) in which I for educational reasons, want to know how to save various message variables with the following data in 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.
I commented on how to use localStorage and sessionStorage in this answer: https://answall.com/a/387053/5407
– Celso Marigo Jr