Hi I am trying to access a parameter in the controller "ViewWorklogCrtl" while using ui-router and running into difficulty.
Basically, my parent template contains:
a(ui-sref="instance-ticket.worklog({id:{{ticket.testnum}}})") show
and then further down the page:
section(ui-view="top-section")
Then in my app.js, containing client-side routing info in short I have:
$stateProvider
.state('instance-ticket', {
url: '/ticket/:instanceID',
templateUrl: 'partials/instance-ticket',
controller: 'ViewTicketCrtl'
})
.state('instance-ticket.worklog', {
views:{
'top-section':{
templateUrl:'/partials/ticket.worklog.jade',
controller: 'ViewWorklogCrtl'
}
}
})
The template loading is working correctly, the issue and question I can't find an answer to is - how to access "testnum" being passed through the ui-sref link, to and within the ViewWorkLogCtrl... Is there a better approach to this?
Much thanks!!!