0

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

2 Answers 2

1

it is easy just put $scope.tasks.push({item:myvar,status:false}); into add function .

Sign up to request clarification or add additional context in comments.

Comments

0

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

5 Comments

@NagaBhavani use this fiddle jsfiddle.net/divm/usabq8a3/2 the count function to show the correct remaining tasks is also updated in this
once analyse the code.If every chexkbox is checked the "remaining pending" should be eliminated and "all task are completed" should be displayed..But now even if all checkboxes are unchecked its showing all tasks are complted
Hey once i enter the text into box and click the button its adding to table but not clearing in the textbox
@NagaBhavani I wish you had figured this out yourself. jsfiddle.net/divm/usabq8a3/4
I have done the same but slight change.Syntax is wrong...Thank you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.