在uigrid里面使用celltemplate嵌入的按钮,使用ng-click点击不能打开新页面,需要增加grid.appScope.具体的函数名切换scope才可以
错误例子:
cellTemplate: '<div ng-switch=row.entity.goodsStatus>' +
'<div ng-switch-when=0><p style="margin-top: 1px"> <button ng-click="onShelf(\'\',\'onShelf.html\',\'on\',row.entity)" class="btn btn-danger btn-xs btn-sm" ><i class="fa fa-close"></i>上架</button></p></div>'
+'</div>',
正确例子:
cellTemplate: '<div ng-switch=row.entity.goodsStatus>' +
'<div ng-switch-when=0><p style="margin-top: 1px"> <button ng-click="grid.appScope.onShelf(\'\',\'onShelf.html\',\'on\',row.entity)" class="btn btn-danger btn-xs btn-sm" ><i class="fa fa-close"></i>上架</button></p></div>'
+'</div>',