Skip to content

Instantly share code, notes, and snippets.

@blackpr
Created March 6, 2017 04:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save blackpr/2e19e060b70e52cafc45bf9694e71f2f to your computer and use it in GitHub Desktop.
Save blackpr/2e19e060b70e52cafc45bf9694e71f2f to your computer and use it in GitHub Desktop.
import { Component, OnInit } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import { TriviaService } from './trivia.service';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent implements OnInit{
question$: Observable<any>;
constructor(private trivia:TriviaService) { }
ngOnInit() {
this.question$ = this.trivia.getQuestion();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment