var MyApi = {}; requirejs(['lib/jquery-1.11.2.min', 'app/fsub'], function($, fsub){ fsub(); MyApi.foo = function(){ alert('Test'); }; } );
<a id="bTest" href="#" οnclick="MyApi.foo()">Link2</a>
var MyApi = {}; requirejs(['lib/jquery-1.11.2.min', 'app/fsub'], function($, fsub){ fsub(); MyApi.foo = function(){ alert('Test'); }; } );
<a id="bTest" href="#" οnclick="MyApi.foo()">Link2</a>