From 5d4f4588a5945ef3907443b148cc69f2ccbd627a Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Sat, 2 May 2020 21:29:05 +0200 Subject: [PATCH] 4: Add Services c) Show messages - Create MessagesComponent --- src/app/app.component.html | 1 + src/app/app.module.ts | 4 +++- src/app/messages/messages.component.css | 0 src/app/messages/messages.component.html | 1 + src/app/messages/messages.component.spec.ts | 25 +++++++++++++++++++++ src/app/messages/messages.component.ts | 15 +++++++++++++ 6 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 src/app/messages/messages.component.css create mode 100644 src/app/messages/messages.component.html create mode 100644 src/app/messages/messages.component.spec.ts create mode 100644 src/app/messages/messages.component.ts 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() { + } + +} -- 2.20.1