Last active
August 29, 2015 14:20
-
-
Save nickgrealy/bc1f5452cff303348fe7 to your computer and use it in GitHub Desktop.
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
var PartnerDetail = (function ($) { | |
"use strict"; | |
var _partnerId = -1; | |
var getPartnerId = function () { | |
return _partnerId; | |
}; | |
var setPartnerId = function (id) { | |
_partnerId = id; | |
} | |
// Public functions | |
return { | |
getPartnerId: getPartnerId, | |
setPartnerId: setPartnerId | |
}; | |
})(jQuery); |
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
var SearchAll = (function ($) { | |
"use strict"; | |
// Private variables | |
// Private functions | |
var init = function () { | |
$("#partner").on("click", function () { | |
var p = PartnerDetail.getPartnerId(); | |
console.log(p); // ==> -1 | |
}); | |
}; | |
// Public functions | |
return { | |
init: init | |
}; | |
})(jQuery); |
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
var SearchForm = (function ($) { | |
"use strict"; | |
// Private variables | |
// Private functions | |
var onSuccess = function () { | |
PartnerDetail.setPartnerId(10); | |
}; | |
// Public functions | |
return { | |
onSuccess: onSuccess, | |
}; | |
})(jQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment