Yep that should do it, and then make sure that this override module is included in your dependency tree.
On Wed, Aug 28, 2013 at 2:47 PM, Chris Geer <[email protected]> wrote: > Ok, so I actually want to overload the getSecurityToken method in the > rave_api.js. So would it look like this? > > define(['core/rave_api'], function (api) { > api.restApi.getSecurityToken = function(){ > console.log('heyoooooo'); > } > }); > > Since that js file returns two objects instead of one? > > Chris > > > On Wed, Aug 28, 2013 at 11:04 AM, Erin Noe-Payne > <[email protected]>wrote: > >> Each module should be resolved only once, so you can write a new >> module that requires in the core module and then overrides the >> function you want. As an example, say I wanted to change the way rave >> core's registerWidget function works.... >> >> define(['core/rave_widget_manager'], function (widgetManager) { >> widgetManager.registerWidget = function(){ >> console.log('heyoooooo'); >> } >> }); >> >> I have now overridden the function with my new implementation. >> >> On Tue, Aug 27, 2013 at 5:54 PM, Chris Geer <[email protected]> wrote: >> > How would I go about replacing a JS function from Rave with my own >> > implementation using the new require approach? I don't want to have to >> > overwrite the whole file if possible. >> > >> > Chris >>
