简体   繁体   English

Mean.JS Angular-返回单个结果

[英]Mean.JS Angular - Returning a single result

Im trying to learn Angular.js and have a small problem here. 我正在尝试学习Angular.js,并在这里遇到了一个小问题。 I have created a page that views ALL customers but what im trying to figure out is how to create a page where you just have an individual customer. 我创建了一个可以查看所有客户的页面,但是我想弄清楚的是如何创建一个只有单个客户的页面。

On the list all customers page i have 在列表所有客户页面上,我有

data-ng-repeat="customer in customers"

which returns all customers but how do i just limit that to an individual result on the view single customer page. 它返回所有客户,但我如何将其限制为在查看单个客户页面上的单个结果。 The URL is customers/55b4fb75778becf4255b2ea5 so i assume it needs to be something equivalent to WHERE customer.id = "55b4fb75778becf4255b2ea5" 该URL为customers / 55b4fb75778becf4255b2ea5,因此我认为它需要与WHERE customer.id =“ 55b4fb75778becf4255b2ea5”等效。

我相信您会使用路线从列表中显示特定客户的详细信息,请尝试在元素{{customers [whichItem] .name}}中使用此方法

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM