In our last post, we created a ViewModel which models the basic functionality we would like on the page. As a reminder, we have a Knockout “observable array” of items suitable for binding; each item is a JavaScript object containing a title and description in addition to a value called complete which indicates if this item has been completed. Our ViewModel function object accepts a parameter of any initial items we may need to load in to to our list from the server. We have a method called add_item which can add new items to our list, and we have a test suite that ensures that all of this is working. So far, all of this is inside a single file calledToDontListSpec.js.
Your new post is loading...