0

I am trying to pass 2 parameters into the ui-grid cell template.

e.g: ng-click="grid.appScope.copyOperation(row.entity, copyOperation).

copyOperation would obviously be a string.

Reason: Reduce redundancy in code by maintaining a single method for all the grid operations(delete, copy and edit) with if else conditions.

On the controller side, the function would be like

$scope.copyOperation= function(row, operation) {
//Do necessary steps by operation
};

But, unfortunately I get undefined in operation (No Errors). So, how do I pass a string in this case? Any alternate suggestions will also be helpful. Thank you!

4

1 回答 1

1

抱歉这个小问题。

ng-click="grid.appScope.copyOperation(row, \'copy\')

会让操作 arg 设置为复制。

谢谢!

于 2015-10-05T20:34:44.690 回答