How can I call the function in ng-click which is defined inside a factory service,
app.factory('MyFactory', [function () {
return {
setTest: function(test) {
alert(test);
}
};
}]);
app.controller('TestCtrl', ['$scope','MyFactory', function ($scope, MyFactory) {
}]);
<li><a href="#" ng-click="setTest('PHP')">PHP</a></li>
<li><a href="#" ng-click="setTest('Javascript')">Javascript</a></li>