javascript - Angular JS custom table directive -


in project working on have lot of serial true/false data needs displayed in different ways. have been working on directive allow me pass in model, table header, , heres tricky part, number of columns.

<serial-checkbox-table title="title" columns="2" ng-model="items"></serial-checkbox-table> 

i cant seem columns parameter respected. built thing @ 1 point html generated in link phase having hard time updating model passed directive.

heres jsfiddle of current state of directive.

http://jsfiddle.net/peledies/2tvae/

anyone have ideas?

what need $scope.$watch on model variable.

here old cold:

var model = $scope.$eval($attrs.ngmodel); ... // compile , write dom 

needs updated to

$scope.$watch($attrs.ngmodel,function(newval,oldval) {     //var model = $scope.$eval($attrs.ngmodel);     // can take model value watch function result     var model = newval;     ...     // compile , write dom }); 

and here jsfiddle updated logic: http://jsfiddle.net/callado4/2tvae/7/


Comments

Popular posts from this blog

php - SPIP: From Tag directly to an article -

jquery - isAjaxRequest always return false -

ruby on rails - In a controller spec, how to find a specific tag in the generated view? -