我还在学习Angular,但我无法弄明白。我正在构建一个Angular电子商务应用程序。构建的REST API有点扁平。 JSON看起来像这样:
SELECT Total from (select sum(ticketnumber) AS total from case)A
Where Total>2
实际的通话网址如下所示:
{
"ShipFrom": "TN",
"PartNumber": "ABC-xyz",
"Category": "ACCESSORIES",
"Description": "ABC Description",
"Price": 13.98,
"PictureURL": "example.com/xyz.jpg"
},
{
"ShipFrom": "TN",
"PartNumber": "EFG-xyz",
"Category": "ACCESSORIES",
"Description": "ABC Description",
"Price": 13.98,
"PictureURL": "example.com/xyz.jpg"
},
有没有办法通过这种类型的回报路由到特定类别?
答案 0 :(得分:0)
您可以使用路由解析。我建议您升级角度版本或使用ui-router,因为您使用的是Angular 1.4.X
假设您的类别页面应显示在http://example.com/category/{category}
上,您设置路由(状态)解析以从json文件中获取所选的{category}
并将其返回。
阅读解决here