projects
/
examples
/
angular-tour-of-heroes
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
4: Add Services
[examples/angular-tour-of-heroes]
/
src
/
app
/
message.service.ts
1
import { Injectable } from '@angular/core';
2
3
@Injectable({
4
providedIn: 'root'
5
})
6
export class MessageService {
7
8
messages : string[] = [];
9
10
add(message : string): void {
11
this.messages.push(message);
12
}
13
14
clear(): void {
15
this.messages = [];
16
}
17
}