Dig-Knockout is a tiny library which trys to show you how the popular library of MVVM works. Maybe you are confused for the mechanism because you have experienced many similar frameworks only by calling API.
So, I write the same functions just like Konockoutjs, some bingdings instruction(text, html, click, if, foreach) has been implimented in this library, I hope this tiny guy could help you understand how to design a framwork of MVVM.
Now let's dig it out together.
- Install node_modules
- Install grunt
npm install -g grunt-cli
- Start Server
- Run Test
grunt testAlso you can open test in browser, Plesae
- Build App
<script src="/bower_components/jquery/dist/jquery.js"></script> <script src="scripts/myknockout.js"></script>
<template id="demo"> <div data-bind="foreach: messages"> <h4> <a data-bind="text: title"></a> </h4> <p data-bind="text: content"></p> </div> </template>