Reputation: 105
http://jsfiddle.net/U3pVM/17674/
Once analyse the code in the above fiddle...What I am trying is when even i enter a item in text box ,the value should be added to the table.
I mean the output is:
Item | Done
Shopping | checkbox with checked if status is true
Cleaning | checkbox based on status
If I add another item in the textbox,that must be added to table dynamically with checkbox false
Upvotes: 0
Views: 85
Reputation: 2053
In your add function push the new item to the scope variable as its an array like given below
$scope.add=function(myvar)
{
$scope.tasks.push({item:myvar,status:false});
}
Here is the working fiddle
Upvotes: 0
Reputation: 1212
it is easy just put $scope.tasks.push({item:myvar,status:false});
into add function .
Upvotes: 1