1
創建我需要做一個後類型在我簡單的角度應用......我有觸點的JSON文件AngularJS路線從JSON數據都相同視圖模板
{
"contacts": [
{
"name": "Alf",
"tel": [
{
"home": "0134567890"
}
],
"address": "1 A Road, A Town, A County, AB123CD",
"email": "[email protected]"
},
{
"name": "Andrew",
"tel": [
{
"mobile": "0774567890"
}
],
"address": "1 A Road, A Town, A County, AB123CD",
"email": "[email protected]"
},
{
"name": "Zoe",
"tel": [
{
"mobile": "07712456789"
}
],
"address": "1 A Road, A Town, A County, AB123CD",
"email": "[email protected]"
}
]
}
我並不需要一個管理員或數據庫,因爲我將維護該網站。使用上面我想點擊一個列表項alf
這將改變路線,以domain.com/alf
或domain.com/contact/alf
其中會使用到contact
模板視圖與alf's
信息(從JSON)
谷歌搜索給我留下了唯一的數據庫/服務器/管理教程。但我的需要更簡單。
所以一言以蔽之 - 我需要一個接受的URL參數將加載對應於所提供的URL參數數據的視圖的路線
謝謝。我想我是在過分簡單的部分。任何最喜歡的教程這個特定的流程? – Omar
@Omar我不確定有沒有關於在AngularJS中使用'json-server'的任何教程。我會建議首先使用'json-server'文檔爲您的文件設置rest api,然後使用角度路由https://docs.angularjs.org/tutorial/step_07創建應用程序,併爲每個路由狀態調用適當的REST api端點https: //docs.angularjs.org/tutorial/step_13 –
謝謝!即時通訊完成後,我會分享結果。 – Omar