Skip to content

Instantly share code, notes, and snippets.

@blackpr
Created March 6, 2017 04:44
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/cbbd56a9bc827f2643842bd1de359a56 to your computer and use it in GitHub Desktop.
Save blackpr/cbbd56a9bc827f2643842bd1de359a56 to your computer and use it in GitHub Desktop.
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