HTML and CSS Reference
In-Depth Information
Secondly, the
taskController
remembers if it has been initialised in a local variable called
initialised
. This ensures that regardless of how many times the
init
method is called, it will
only actually initilaize the controller once.
With the controller in place, tasks.html needs to be altered to invoke the
init
method when
the page is loaded. The script block in tasks.html should now contain the following:
<script>
$(document).ready(function() {
tasksController.init($('#taskPage'));
});
</script>