Advertisement
Guest User

Untitled

a guest
Aug 29th, 2015
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. var StateController = new function(){
  2. this.GetState = function(){
  3. $(document).trigger('navestate:giveMeTheState',this)
  4. };
  5. this.hereYouGo = function(navState){
  6. // Do something with navState
  7. };
  8. };
  9.  
  10. var NavState = new function(){
  11. var myNaveState = { nav : 'state' };
  12. $(document).on('navestate:giveMeTheState',function(e, giveItTo){
  13. giveItTo.hereYouGo(myNaveState);
  14. });
  15. };
  16.  
  17. StateController.GetState();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement