Call a method in ui-sref in angularJS -


i have below code in nggrid:

celltemplate: '<div class="padding-t-5 padding-l-5"><a ui-sref="editcamera({id:row.entity.id})" ><i class="fa fa-edit margin-r-10"></i></a>\n\                     <button ng-click="confirmclick() && grid.appscope.deleterow(row)" confirm-click><i class="fa fa-trash"></i></button></div>' 

i wondering how define editcamera method mentioned in ui-sref controller.

if add ng-click how pass id (passed on ui-sref)

i tried define using $scope.editcamera, dint worked.

****update******

what need perform add , edit operations in same controller, need different method edit operation.

ui-sref treat editcamera() state angular routing when compiled converts ng-href . if define editcamera() in controller wont called routing state , params pass i.e id act routes parameter . call function need use ng-click instead .

or if going routing create editcamera state params id , use ui-sref .


Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -