Created
March 6, 2017 04:43
-
-
Save blackpr/9ead20d395b59eca8b8cde9a7badbc45 to your computer and use it in GitHub Desktop.
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 { Injectable } from '@angular/core'; | |
import { Observable } from 'rxjs/Observable'; | |
import 'rxjs/add/observable/of'; | |
import 'rxjs/add/operator/delay'; | |
@Injectable() | |
export class TriviaService { | |
question$ = Observable.of({ | |
"category": "Science: Mathematics", | |
"type": "boolean", | |
"difficulty": "medium", | |
"question": "The Pythagorean theorem states that the square of the hypotenuse is equal to the product of the squares of the other two sides.", | |
"correct_answer": "False", | |
"incorrect_answers": ["True"] | |
}) | |
.delay(2000); | |
constructor() { } | |
getQuestion() { | |
return this.question$; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment