脚本宝典收集整理的这篇文章主要介绍了angular v1.5.8 表格增删改查,脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
1 Class("active"); obj.addClass("inactive"); obj.attr("readOnly",true); scope.$apply(function(){ scope.showEdit = true; }) }) } } }); app.directive("cancel",function($document){ return{ restrict: 'AE', require: 'ngModel', link: function(scope,element,attrs,ngModel){ element.bind("click",function(){ scope.$apply(function(){ angular.copy(scope.master,ngModel.$modelValue); //console.log(ngModel.$modelValue); }) var id = "txt_name_" +ngModel.$modelValue.id; var obj = $("#"+id); obj.removeClass("active"); obj.addClass("inactive"); obj.prop("readOnly",true); scope.$apply(function(){ scope.showEdit = true; }) }) } } }); app.directive("delete",function($document){ return{ restrict:'AE', require: 'ngModel', link:function(scope, element, attrs,ngModel){ element.bind("click",function(){ var id = ngModel.$modelValue.id; alert("delete item where employee id:=" + id); scope.$apply(function(){ for(var i=0; i