4: Add Services
authorKai Moritz <kai@juplo.de>
Sat, 2 May 2020 19:29:05 +0000 (21:29 +0200)
committerKai Moritz <kai@juplo.de>
Sat, 2 May 2020 19:29:05 +0000 (21:29 +0200)
c) Show messages - Create MessagesComponent

src/app/app.component.html
src/app/app.module.ts
src/app/messages/messages.component.css [new file with mode: 0644]
src/app/messages/messages.component.html [new file with mode: 0644]
src/app/messages/messages.component.spec.ts [new file with mode: 0644]
src/app/messages/messages.component.ts [new file with mode: 0644]

index ee3d478..cb45ac4 100644 (file)
@@ -1,2 +1,3 @@
 <h1>{{title}}</h1>
 <app-heroes></app-heroes>
+<app-messages></app-messages>
index 39fe27d..c84535d 100644 (file)
@@ -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 (file)
index 0000000..e69de29
diff --git a/src/app/messages/messages.component.html b/src/app/messages/messages.component.html
new file mode 100644 (file)
index 0000000..89b9fa6
--- /dev/null
@@ -0,0 +1 @@
+<p>messages works!</p>
diff --git a/src/app/messages/messages.component.spec.ts b/src/app/messages/messages.component.spec.ts
new file mode 100644 (file)
index 0000000..66109cc
--- /dev/null
@@ -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<MessagesComponent>;
+
+  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 (file)
index 0000000..1ff6603
--- /dev/null
@@ -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() {
+  }
+
+}