1

I really wish I was doing something wrong here. Please see my js bin. http://jsbin.com/benewetewe/1/edit?html,js,output

Some user-story:

  1. When I check items and click "archive", it filters all "bought:true" away.
  2. When I click the "show history", it shows back all items whether its "bought:true" or not.
  3. But I noticed a problem, when I add new item in the list and click "archive", the new item is hid even if it's not yet "bought:true".
  4. But If I try to select & de-select the new item, it will now be part of the hid items when "archive" is clicked.

Anything I missed?

Thanks!

1 Answer 1

1

You have a small typo in your code, which caused the problem :

$scope.toBuyAddItem = function (toBuyItem) {
    toBuyItem.bough = false;  /* <-- typo : change .bough to .bought */
    $scope.toBuyList.push(toBuyItem);
    $scope.toBuyItem = {};
};

Add a letter 't' to fix all your problems ;)

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

1 Comment

thanks, knew it i'm doing something not right..darn it _

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.