我有一個需要我使用下劃線模板的項目。項目幫助:下劃線模板
該應用程序假設從API獲取配方並將其呈現給頁面。 如果用戶喜歡食譜,他們將能夠保存它以備後用。
任何人都可以幫助我瞭解如何實現這一目標嗎?我不確定是否應該從客戶端或服務器完成請求。另外,我不太確定從API(JSON)返回的數據將如何呈現給頁面。
下面是JSON對象我使用的API郵遞員:
{"recipe": {
"publisher": "Closet Cooking",
"f2f_url": "http://food2fork.com/view/35171",
"ingredients": [
"1/4 cup cooked shredded chicken, warm",
"1 tablespoon hot sauce",
"1/2 tablespoon mayo (optional)",
"1 tablespoon carrot, grated",
"1 tablespoon celery, sliced",
"1 tablespoon green or red onion, sliced or diced",
"1 tablespoon blue cheese, room temperature, crumbled",
"1/2 cup cheddar cheese, room temperature, grated",
"2 slices bread",
"1 tablespoon butter, room temperature\\\n"
],
"source_url": "http://www.closetcooking.com/2011/08/buffalo-chicken-grilled-cheese-sandwich.html",
"recipe_id": "35171",
"image_url": "http://static.food2fork.com/Buffalo2BChicken2BGrilled2BCheese2BSandwich2B5002B4983f2702fe4.jpg",
"social_rank": 100,
"publisher_url": "http://closetcooking.com",
"title": "Buffalo Chicken Grilled Cheese Sandwich"}}