diff --git a/project/src/app/app.component.html b/project/src/app/app.component.html
index e6bcc99..dab2166 100644
--- a/project/src/app/app.component.html
+++ b/project/src/app/app.component.html
@@ -1,9 +1,9 @@
-
+
\ No newline at end of file
diff --git a/project/src/app/app.component.ts b/project/src/app/app.component.ts
index 7513378..06499a0 100644
--- a/project/src/app/app.component.ts
+++ b/project/src/app/app.component.ts
@@ -7,4 +7,9 @@ import { Component } from '@angular/core';
})
export class AppComponent {
title = 'project';
+ loadedFeature = 'recipe';
+
+ onNavgate(feature: string) {
+ this.loadedFeature = feature;
+ }
}
diff --git a/project/src/app/header/header.component.html b/project/src/app/header/header.component.html
index bf6adff..9c8ddbc 100644
--- a/project/src/app/header/header.component.html
+++ b/project/src/app/header/header.component.html
@@ -5,8 +5,8 @@
-
diff --git a/project/src/app/header/header.component.ts b/project/src/app/header/header.component.ts
index a093fe7..91e6ec5 100644
--- a/project/src/app/header/header.component.ts
+++ b/project/src/app/header/header.component.ts
@@ -1,15 +1,15 @@
-import { Component, OnInit } from '@angular/core';
+import { Component, EventEmitter, Output } from '@angular/core';
@Component({
selector: 'app-header',
templateUrl: './header.component.html',
styleUrls: ['./header.component.css']
})
-export class HeaderComponent implements OnInit {
+export class HeaderComponent {
+ @Output() featureSelected = new EventEmitter();
- constructor() { }
-
- ngOnInit(): void {
+ onSelect(feature: string) {
+ this.featureSelected.emit(feature);
}
}
diff --git a/project/src/app/recipes/recipe-list/recipe-item/recipe-item.component.html b/project/src/app/recipes/recipe-list/recipe-item/recipe-item.component.html
index e819b71..2a0caf3 100644
--- a/project/src/app/recipes/recipe-list/recipe-item/recipe-item.component.html
+++ b/project/src/app/recipes/recipe-list/recipe-item/recipe-item.component.html
@@ -1,3 +1,15 @@
-
- recipe-item works!
-
+
+
+
{{ recipe.name }}
+
{{ recipe.description }}
+
+
+
+
+
\ No newline at end of file
diff --git a/project/src/app/recipes/recipe-list/recipe-item/recipe-item.component.ts b/project/src/app/recipes/recipe-list/recipe-item/recipe-item.component.ts
index 6da52d7..937b97b 100644
--- a/project/src/app/recipes/recipe-list/recipe-item/recipe-item.component.ts
+++ b/project/src/app/recipes/recipe-list/recipe-item/recipe-item.component.ts
@@ -1,4 +1,5 @@
-import { Component, OnInit } from '@angular/core';
+import { Component, Input, OnInit } from '@angular/core';
+import { Recipe } from '../../recipe.model';
@Component({
selector: 'app-recipe-item',
@@ -6,6 +7,7 @@ import { Component, OnInit } from '@angular/core';
styleUrls: ['./recipe-item.component.css']
})
export class RecipeItemComponent implements OnInit {
+ @Input() recipe: Recipe;
constructor() { }
diff --git a/project/src/app/recipes/recipe-list/recipe-list.component.html b/project/src/app/recipes/recipe-list/recipe-list.component.html
index 33796fa..acc2826 100644
--- a/project/src/app/recipes/recipe-list/recipe-list.component.html
+++ b/project/src/app/recipes/recipe-list/recipe-list.component.html
@@ -6,23 +6,9 @@