From 10eed64c6e7bf1173059adb2f5411f64edc2f612 Mon Sep 17 00:00:00 2001 From: warrenmazmur Date: Thu, 20 May 2021 14:20:05 +0700 Subject: [PATCH 1/2] fix Treasure interface usage --- src/app/mock-treasures.ts | 4 +++- src/app/treasure.ts | 5 +++++ src/app/treasure/treasure.component.ts | 11 +++++------ 3 files changed, 13 insertions(+), 7 deletions(-) create mode 100644 src/app/treasure.ts diff --git a/src/app/mock-treasures.ts b/src/app/mock-treasures.ts index 8eed52e..b65ac0f 100644 --- a/src/app/mock-treasures.ts +++ b/src/app/mock-treasures.ts @@ -1,4 +1,6 @@ -export interface Treasure { +import { Treasure } from './treasure'; + +export const treasureMock: Treasure = { id: 1, name: 'Windstorm Gold Staff', location: 'Tree behind home', diff --git a/src/app/treasure.ts b/src/app/treasure.ts new file mode 100644 index 0000000..85a2395 --- /dev/null +++ b/src/app/treasure.ts @@ -0,0 +1,5 @@ +export class Treasure { + id: number; + name: string; + location: string; +}; \ No newline at end of file diff --git a/src/app/treasure/treasure.component.ts b/src/app/treasure/treasure.component.ts index da70959..f55655c 100644 --- a/src/app/treasure/treasure.component.ts +++ b/src/app/treasure/treasure.component.ts @@ -1,5 +1,7 @@ import { Component,OnInit } from '@angular/core'; -import { Treasure } from '../mock-treasures'; +import { treasureMock } from '../mock-treasures'; +import { Treasure } from '../treasure' + @Component({ selector: 'app-treasure', templateUrl: './treasure.component.html', @@ -7,11 +9,8 @@ import { Treasure } from '../mock-treasures'; }) export class TreasureComponent implements OnInit { - treasure: Treasure = { - id: 1, - name: 'Windstorm Gold Staff', - location: 'Tree behind home', - }; + treasure:Treasure = treasureMock + constructor() { } ngOnInit() { From 40d79954c5ff59be4b04a85a0a03dfe67da3a19d Mon Sep 17 00:00:00 2001 From: warrenmazmur Date: Thu, 27 May 2021 16:23:03 +0700 Subject: [PATCH 2/2] remove unnecessary bold element --- src/app/treasure/treasure.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/treasure/treasure.component.html b/src/app/treasure/treasure.component.html index 1a70fa7..d85ba57 100644 --- a/src/app/treasure/treasure.component.html +++ b/src/app/treasure/treasure.component.html @@ -2,7 +2,7 @@

{{treasure.name}} Details