-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Started adding in Monster information
- Loading branch information
Derek McDaniel
committed
Mar 5, 2019
1 parent
f613099
commit 2209441
Showing
8 changed files
with
100 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<div class="container"> | ||
|
||
<div class="col-md-12" *ngIf="monster"> | ||
<h2>{{ monster.name }}</h2> | ||
<p>{{ monster.desc }}</p> | ||
|
||
<div class="row"> | ||
|
||
<div class="col-md-4"> | ||
|
||
</div> | ||
|
||
<div class="col-md-4"> | ||
|
||
</div> | ||
|
||
<div class="col-md-4"> | ||
|
||
</div> | ||
</div> | ||
|
||
</div> | ||
|
||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { MonsterComponent } from './monster.component'; | ||
|
||
describe('MonsterComponent', () => { | ||
let component: MonsterComponent; | ||
let fixture: ComponentFixture<MonsterComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [ MonsterComponent ] | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(MonsterComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
import { ActivatedRoute, Router } from '@angular/router'; | ||
import { Monster } from '../../domain/monsters'; | ||
import { MonstersService } from '../../services/monsters.service'; | ||
|
||
@Component({ | ||
selector: 'app-monster', | ||
templateUrl: './monster.component.html', | ||
styleUrls: ['./monster.component.css'] | ||
}) | ||
export class MonsterComponent implements OnInit { | ||
public monster: Monster | ||
private id: any; | ||
|
||
constructor( | ||
private monsterService: MonstersService, | ||
private router: Router, | ||
private activatedRoute: ActivatedRoute | ||
) { | ||
|
||
this.activatedRoute.params | ||
.subscribe(params => { | ||
if (params.id) { | ||
this.id = params.id; | ||
} else { | ||
// redirect back to monsters | ||
} | ||
}); | ||
|
||
|
||
} | ||
|
||
ngOnInit() { | ||
this.monsterService.getMonster(this.id).subscribe(monster => { this.monster = monster; }); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters