HTML and CSS Reference
In-Depth Information
<a href="#" class="deleteRow">Delete</a>
</nav>
</td>
</tr>
</script>
</html>
And the project structure will look as follows:
We now want to start writing the code for tasks-controller.js. This will utilize the module
pattern introduced earlier in the JavaScript chapter. This will ensure the controller can en-
capsulate data, and expose a public API to the rest of the application.
The controller will be responsible for initializing the form, handling events, and managing
any state required by the page. The basic structure of our tasks controller is as follows:
tasksController = function() {
return {
init : function(page) {
}
}
}();
This code is implementing exactly the same pattern as was implemented earlier with the
createIncrementer function. The only difference here is that we have not named the func-
tion that is returning the object: it is an anonymous function that we are executing immedi-
ately by adding () to the end of the line.
Search WWH ::




Custom Search