Skip to content

Instantly share code, notes, and snippets.

@rahulsahay19
Created December 18, 2016 05:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rahulsahay19/e328b604709ba0ab68c43d5de4aeb11c to your computer and use it in GitHub Desktop.
Save rahulsahay19/e328b604709ba0ab68c43d5de4aeb11c to your computer and use it in GitHub Desktop.
movieApp
define("movieApp",["movieManagement"],function(movieManagement){
/* event handlers */
// Its good idea to prefix private methods with _
function _registerEventHandlers() {
$("#new-movie-button").on("click", movieManagement.add);
$("#delete-all-button").on("click", movieManagement.clear);
$("#save-button").on("click", movieManagement.save);
$("#movie-list").on("click", ".delete-button", movieManagement.remove);
}
return{
init:function(){
_registerEventHandlers();
movieManagement.render();
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment