Why not fire the controller?

Good day! Recommended your online. I hope for your understanding and kindness.

Faced here what problem.

In angular use ui-router.

.state('editRole', {
 url: '/roles/:id/edit',
 templateUrl: '../views/RoleManagement/role-edit.html',
 controller: 'RoleController as role'

in the template
<a class="btn btn-danger" ng-click="role.deleteRole(current_role.id, $index)">Delete</a>
 <a class="btn btn-warning" ui-sref="editRole({id:current_role.id})">Edit</a>
 <a class="btn btn-warning" ng-click="role.editRole(current_role.id)">Edit2</a>

So. ui-sref generates the link. Pass. But the function controller does not work.
Edit2 Delete and work. I guess it's all about role. But if it is added to do
ui-sref="role.editRole({id:current_role.id})"> "Edit", then get error state.

code from controller
(function() {

 'use strict';

 .controller('RoleController', RoleController);

 RoleController function($http, $auth, $state, $stateParams, $rootScope, Role) {

 var vm = this;
 vm.test = function() {

 vm.editRole = function(id) {
 .success(function(data) {

How would one solve this issue?

And along the way.
These RoleController as role? May not use? In templates all gets cluttered with these supplements role.

PS the test function is activated twice when getting on this route((
Grand merci in advance
July 2nd 19 at 14:10
1 answer
July 2nd 19 at 14:12
We assume that in the sref, it is possible to transmit only state, with or without parameters https://github.com/angular-ui/ui-router/wiki/Quick... Maybe your editRole method in the controller somehow conflict with the state which has the same name.
Try in the controller call $state.go(...) when you click the link.

Find more questions by tags Angular