[Owncloud] Routing for Dummies and best practices

Thomas Tanghus thomas at tanghus.net
Thu Mar 21 12:12:50 UTC 2013


On Thursday 21 March 2013 10:21:20 Bart Visscher wrote:
> On Thu, Mar 21, 2013 at 02:01:49AM +0100, Thomas Tanghus wrote:
> > Am I right so far or have I totally misunderstood it?
> 
> Yes, this is how to use the routing system.

Great. I will see if I can add some lines to the documentation, because it's 
not really clear about what's happening.
 
> > So can I add more parameters to the OC.Router.generate() call and have
> > them available in $params or will they have to be in the URI?

Ah, OK. 

> > Would this be the proper way to use it:
> > $(document).ready(function() {
> > 	OC.Router.registerLoadedCallback(function() {
> > 		OC.Contacts.init();
> > 	});
> > });
> 
> If you use OC.Router.generate() in OC.Contacts.init() then this is the
> way to go. The routes are loaded async, so it is possible they are not
> available on document ready.

Well I instantiate the objects that uses the storage object that uses 
OC.Router.generate() there ;)

Thanks for clearing this up.

-- 
Best regards / Med venlig hilsen

Thomas Tanghus



More information about the Owncloud mailing list