Challenge Lab #2 (Assignment #21) Adding a Random Keyed Humor button 1) I added this method to the humorHttp Interface: getRandomKeyedHumor(type: string) : Observable; 2) I added this implementation of the new method to the humor.service.ts file: private randomKeyedHumorURL = "/keyed/random/"; getRandomKeyedHumor(type: string) : Observable { return this.http.get(this.humorRestURL + this.randomKeyedHumorURL + "/" + type); }; 3) I added this the bottom of keyed.component.html from:
4) I add the new method used in the HTML to the keyed.component.ts file findRandomKeyed(): boolean { this.humorService.getRandomKeyedHumor(this.category.id).subscribe(results => { this.keyedHumor = results; }); return false; }