0
I’m having trouble making a POST using ui-sref. I need to call a controller passing an ID where it will return me the recorded data in the database. Works great when using route, but when I use ui.route I’m having trouble.
With ngRouter
.when("/highways/:id",
{
templateUrl: "assets/templates/highway/edit.html",
controller: "HighwayController",
controllerAs: "ctrl"
})
With ui.router
.state('highways.id', {
url: '/:id',
templateUrl: 'assets/templates/highway/edit.html',
controller: 'HighwayController as ctrl'
})
Call in html
<tr ng-repeat="hw in ctrl.search.results" ui-sref="highways.id(hw)">
<!--ng-click="ctrl.search.redirectToItem(hw)"-->
This ng-click is the call that was working before using ui.router.
I did, but it does not call the other template where the data should be loaded.
– Yehudi Mikhael
Is there any configuration that needs to be done within $state Highway.id ?
– Yehudi Mikhael