view src/app/mail.service.ts @ 6:ee4353d1aeeb

Add skeleton files for waveform component.
author Lucas Thompson <dev@lucas.im>
date Wed, 26 Oct 2016 16:57:51 +0100
parents 44c99e3cb108
children
line wrap: on
line source
import { Injectable } from '@angular/core';

@Injectable()
export class MailService {

  messages = [
    {id: 0, text: `You've got mail!`},
    {id: 1, text: `No Mail!`},
    {id: 2, text: `Spam!`}
  ];

  constructor() { }

  update(id, text) {
    this.messages = this.messages.map(message =>
      message.id === id
        ? {id, text}
        : message
    )
  }

}