Muthu Muthu - 5 months ago 23
AngularJS Question

how to clone table row with one way binding in angular js

i'm new to angular js. i'm need to add new row in table to get different values from textbox. i am using custom directive with transclude template. New row is added but all textbox binding same value when i typing on textbox.

Answer

No need to have custom directive, I edited your plunker.http://plnkr.co/edit/WEhaTQFYeWHKZYSeGDdL?p=preview

The goal is to create in scope a structure to get values :

$scope.rows = [{}]
$scope.addnewrow = function(){
           $scope.rows.push({})
        };

And use ng-repeat to dislay data

Comments