From: Kai Moritz Date: Sat, 2 May 2020 19:29:05 +0000 (+0200) Subject: 4: Add Services X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=5d4f4588a5945ef3907443b148cc69f2ccbd627a;p=examples%2Fangular-tour-of-heroes 4: Add Services c) Show messages - Create MessagesComponent --- diff --git a/src/app/app.component.html b/src/app/app.component.html index ee3d478..cb45ac4 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -1,2 +1,3 @@

{{title}}

+ diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 39fe27d..c84535d 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -5,12 +5,14 @@ import { FormsModule } from '@angular/forms'; import { AppComponent } from './app.component'; import { HeroesComponent } from './heroes/heroes.component'; import { HeroDetailComponent } from './hero-detail/hero-detail.component'; +import { MessagesComponent } from './messages/messages.component'; @NgModule({ declarations: [ AppComponent, HeroesComponent, - HeroDetailComponent + HeroDetailComponent, + MessagesComponent ], imports: [ BrowserModule, diff --git a/src/app/messages/messages.component.css b/src/app/messages/messages.component.css new file mode 100644 index 0000000..e69de29 diff --git a/src/app/messages/messages.component.html b/src/app/messages/messages.component.html new file mode 100644 index 0000000..89b9fa6 --- /dev/null +++ b/src/app/messages/messages.component.html @@ -0,0 +1 @@ +

messages works!

diff --git a/src/app/messages/messages.component.spec.ts b/src/app/messages/messages.component.spec.ts new file mode 100644 index 0000000..66109cc --- /dev/null +++ b/src/app/messages/messages.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { MessagesComponent } from './messages.component'; + +describe('MessagesComponent', () => { + let component: MessagesComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ MessagesComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(MessagesComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/messages/messages.component.ts b/src/app/messages/messages.component.ts new file mode 100644 index 0000000..1ff6603 --- /dev/null +++ b/src/app/messages/messages.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-messages', + templateUrl: './messages.component.html', + styleUrls: ['./messages.component.css'] +}) +export class MessagesComponent implements OnInit { + + constructor() { } + + ngOnInit() { + } + +}