Constructor
new ViewFeaRecipe()
Attach the shadowroot which contains the View Recipe Page materials.
- Source:
Members
data
The data needed to populate the materials are passed in as "data".
- Source:
Methods
changeHeart(data, cardObj)
Toggles on and off the heart based on favorite.
Parameters:
| Name | Type | Description |
|---|---|---|
data |
Object | a JSON data object contains information to keep track of which recipe is being added to favorites. |
cardObj |
HTMLElement | an HTML element that contains the heart image. |
- Source:
Returns:
Void
feaRecipeToLand()
Leave Featured Recipe Page to landing page using router object.
- Source:
Returns:
Void
(async) fetchConvertUnit(dataToConvert, locationObject)
Make a GET call to the netlify function using provided parameters, which would then
returns the converted result from spoonacular API.
Parameters:
| Name | Type | Description |
|---|---|---|
dataToConvert |
Object | JSON object contains parsed unit conversion data. |
locationObject |
HTMLElement | HTML element contain the location to display result. |
- Source:
Returns:
a Promise of fetched data.
playTextToSpeech()
Play the instruction step by step
- Source:
Returns:
Void
viewNutrition(data)
View nutrition facts about the selected recipe.
Parameters:
| Name | Type | Description |
|---|---|---|
data |
Object | a JSON data object contains information to load the nutrition page. |
- Source:
Returns:
Void