I have a button that loads the a view using ui router
<button ui-sref="manageactivity.update" >Edit Event</button>
and I would like to pass a {{activity.id}} into the template
app.config(function ($stateProvider, $urlRouterProvider) {
$stateProvider
.state('manageactivity.update', {
url: '/update/:id',
templateUrl: "update.html",
controller: 'eventMgmtCtrl'
});
});
app.controller("eventMgmtCtrl", function ($scope,$stateParams) {
$scope.testID = $stateParams.id;
});
I do know how to do it in normal angular routing, by passing it through the url as such, but it does not work for ui router because ui-router uses the name of the state instead of the url?
<button data-ng-href="#Update/{{activity.id}}" >Edit Event</button>
What changes do I need ?