我有一个AngularJS - ui.router应用程序和我使用远程json。
json的形式如下:
{"data":[
{ "id":0, "name": "Alice","surename": "peterson" },
{ "id":1, "name": "Bob","surename": "peterson" },
{ "id":2, "name": "Alirce","surename": "peterson" },
{ "id":3, "name": "Alwicse","surename": "peterson" },
{ "id":10, "name": "Alice","surename": "peterson" },
{ "id":12, "name": "Alirce","surename": "peterson" },
{ "id":13, "name": "Alwicse","surename": "peterson" },
{ "id":4, "name": "Awlice","surename": "peterson" },
{ "id":7, "name": "Awlice","surename": "peterson" },
{ "id":6, "name": "Awlice","surename": "Peterson" }
]}
如果我点击非相关号码(即10,12,13),该应用程序不会显示项目详细信息。但如果我点击一个相关的数字(0,1,2,3)就行了! 您可以在plunkr
上查看工作应用