how to call a function in a service dynamically in angularjs
<p>I want to invoke a function within a service based on the function name.<br/>
For example, passing a string as the function name and invoke it dynamically.<br/>
Can this be implemented using angular way?<br/><br/>
The code in plunker is : <a href="http://plnkr.co/edit/A9RjFqcuc1FfuqmC4o02?p=preview" rel="nofollow">http://plnkr.co/edit/A9RjFqcuc1FfuqmC4o02?p=preview</a></p>

<p>Main code is also listed below for your quick glance:<br/></p>

<p><div class="snippet" data-lang="js" data-hide="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>    var app = angular.module('app', []);

    app.service("testService", [ function() {
        this.test = function(value){
            alert(value);
        };
    }])
    app.controller('testController', ['$scope', '$injector', '$parse', function($scope, $injector, $parse) {

        $scope.v = '123';
        $scope.click = function(param) {
            var service = $injector.get('testService');
//            service.test($scope.v);
            var expressionHandler = $parse('service.' + param + '($scope.v)');
//            expressionHandler($scope);
//            $scope.$apply(function() {expressionHandler($scope, $scope.users);});
//            $scope.$eval('service.test', {'value': $scope.value})
        };

    }]);</code></pre>
<pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!doctype html&gt;
&lt;html ng-app="app"&gt;
&lt;head&gt;
    &lt;script src="//ajax.googleapis.com/ajax/libs/angularjs/1.5.0/angular.js"&gt;&lt;/script&gt;
    &lt;script src="script.js"&gt;&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;

&lt;div ng-controller="testController"&gt;
    &lt;button type="button" ng-click="click('test')"&gt;click&lt;/button&gt;
&lt;/div&gt;

&lt;/body&gt;
&lt;/html&gt;</code></pre>
</div>
</div>
</p>