I'm having trouble doing a POST using ui-sref. I need to call a controller by passing an ID where it will return me the data recorded in the database. It works fine when I use the route, but when I use ui.route I'm having a problem.
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'
})
Calling 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.