Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /** js object built like a java class with private and public API */
- var usernameHandler = ( function() {
- // private api
- var _srvCallbk = function( data ) {
- $('#usernameContainer').html( data.username );
- };
- var _callService = function() {
- _privatefunctionAjaxCall( _srvCallbk );
- };
- var _privatefunctionAjaxCall( callback ) {
- // ... here for example you can do an ajax call to a service
- }
- // public api
- return {
- setUsername: _callService
- }
- }());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement