Created
December 21, 2016 11:49
-
-
Save rahulsahay19/455ce08d58fd4af7baa43f8d94ba0437 to your computer and use it in GitHub Desktop.
moviesApp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define("movieApp",["jquery","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(); | |
} | |
} | |
}); | |
//To specfify what modules we are dependent on, we need to include require | |
require(["movieApp"],function(movieApp){ | |
/* initialize app */ | |
movieApp.init(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment