使用angularJS / MVC WEB api更新行时如何跟踪和显示?

时间:2021-05-31 15:20:54

I have a SPA with a grid of people. As changes are made to a person I want a visual indicator so something like this within the ng-repeat

我有一个人的网格SPA。随着对一个人的改变我想要一个视觉指示器,所以在ng-repeat中就是这样的

 <span ng-show="show_check()"><i class="icon-ok"></i></span>

So do I

我也是

  1. Extend the place model with an additional Boolean field to track this ? But if I do this I need to stop the Data Model edmx file from overwriting the custom field. Also, I don't want this info saved to the server anyways.. I just want to show what rows have been edited purely on the client side

    使用额外的布尔字段扩展场所模型以跟踪此情况?但是,如果我这样做,我需要停止数据模型edmx文件覆盖自定义字段。此外,我不希望这些信息保存到服务器..我只是想显示纯粹在客户端编辑的行

  2. Create a array in javascript and for each row in ng-repeat do I check the current row ID vs the collection of IDs in the array (The array containing the items already updated)

    在javascript和ng-repeat中的每一行创建一个数组我是否检查当前行ID与数组中的ID集合(包含已更新项的数组)

Or is there a better way? I am new to angular and do not want to do things the hard way..

或者,还有更好的方法?我是棱角分明的新人,不想用艰难的方式做事。

1 个解决方案

#1


1  

I am not entirely clear of what you are asking, the question seems to be mixing client concepts with server logic (EDMX?). But if you are using a form for editing, there is a way to detect if the form is dirty.

我并不完全清楚你在问什么,问题似乎是将客户概念与服务器逻辑(EDMX?)混合在一起。但是,如果您使用表单进行编辑,则可以检测表单是否脏。

See the form directive:

请参阅表单指令:

http://docs.angularjs.org/api/ng.directive:form

http://docs.angularjs.org/api/ng.directive:form

http://docs.angularjs.org/api/ng.directive:ngModel.NgModelController

http://docs.angularjs.org/api/ng.directive:ngModel.NgModelController

HTH

HTH

#1


1  

I am not entirely clear of what you are asking, the question seems to be mixing client concepts with server logic (EDMX?). But if you are using a form for editing, there is a way to detect if the form is dirty.

我并不完全清楚你在问什么,问题似乎是将客户概念与服务器逻辑(EDMX?)混合在一起。但是,如果您使用表单进行编辑,则可以检测表单是否脏。

See the form directive:

请参阅表单指令:

http://docs.angularjs.org/api/ng.directive:form

http://docs.angularjs.org/api/ng.directive:form

http://docs.angularjs.org/api/ng.directive:ngModel.NgModelController

http://docs.angularjs.org/api/ng.directive:ngModel.NgModelController

HTH

HTH