Created
August 7, 2017 00:05
-
-
Save YonathanMeguira/c042d6ed39122a9b15705070e7258b06 to your computer and use it in GitHub Desktop.
retrievingMonsters
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
import {Component, OnInit} from '@angular/core'; | |
import {Monsters} from './monsters'; | |
@Component({ | |
selector: 'monsters', | |
templateUrl: './monsters.component.html', | |
styleUrls: ['./monsters.component.css'] | |
}) | |
export class MonstersComponent implements OnInit { | |
currentSelectedMonster: string; | |
constructor(private monsterService: Monsters){} | |
ngOnInit(){ | |
this.monsterService.monsters.subscribe( | |
monster => this.currentSelectedMonster = monster | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment