JSFiddle - React, Tailwind, and code Playground
HTML
<div ng-app="application">
{{1+2}}
<div ng-controller="myController">
{{something}}<br>
{{getter('some parameter')}}
</div>
</div>
JavaScript
angular.module('application', [])
.factory('myService',
['$log',
function(console) {
console.log('in service');
getMethod = function(param) {
console.log('calling get');
return param;
};
return {getMethod: getMethod};
}
])
.controller('myController',
['$log', '$scope', 'myService',
function(console, $scope, service) {
$scope.something = "here it is";
$scope.getter = service.getMethod;
}
])
;