JSFiddle - React, Tailwind, and code Playground

HTML

<div ng-app="abc" ng-controller="test">
        {{greeting}}
    </div>

JavaScript

var app = angular.module('abc', []);

app.factory('greeter', function($rootScope){
    return{
        greet: function(){
            alert('run');
        }
    }
});
app.controller('test', function($scope, greeter){
    $scope.sayhello = function(){
        greeter.greet();
    };
    $scope.greeting = $scope.sayhello();
});