I have a custom section in the backend for which I have created a TreeController and I have a custom tree node collection for which I am setting urls to custom angular pages which have angular controllers.
I am passing in the ID of the current logged in user as part of the url.
I was wondering if someone could help me get the the parameter from the url in the controller?
Get backend URL Parameter
Hi,
I have a custom section in the backend for which I have created a TreeController and I have a custom tree node collection for which I am setting urls to custom angular pages which have angular controllers.
I am passing in the ID of the current logged in user as part of the url.
I was wondering if someone could help me get the the parameter from the url in the controller?
An example of the url is: http://dev.slaterbarton.co.uk/umbraco#/SlaterBartonMembersUmbraco/Worksheets/NewWorksheet/0
And it is the 0 I am wanting to get so that I can write a custom method to get the user details from the db.
Thanks, Jay
Hi Jay,
You need to inject
$routeParams
into your angular controller and then you can get the id by using$routeParams.id
Here are some examples : https://github.com/dawoe/umbraco-tour-editor/blob/develop/Source/Our.Umbraco.TourEditor/Web/App_Plugins/TourEditor/scripts/controllers/edit-file-controller.js#L4
https://github.com/dawoe/umbraco-tour-editor/blob/develop/Source/Our.Umbraco.TourEditor/Web/App_Plugins/TourEditor/scripts/controllers/edit-file-controller.js#L47
Dave
Hi,
Thank you for your reply I managed to work it out in the end. Do you have any idea of how I can add more params?
Thanks Jay
Hi Jay,
Never tried that. Will try to see if it's possible.
Dave
Hi Dave,
Thank you appreciate your efforts.
Jay
Hi Jay,
did you figure this one out yet ?
Dave
Hi Dave,
No I havent tried yet as I have been able to do everything I need using the user id.
Did you manage to find any time to look at this?
Thanks, Jay
Nope not yet. Just checking if my help is still needed.
Dave
Yes please Dave it would be great if you could look into this?
Thanks, Jay
is working on a reply...