JSFiddle - React, Tailwind, and code Playground

by spechackers

HTML

<body ng-app="MyApp" ng-controller="MyCtrl">
   {{providerOutput}}
</body>

JavaScript

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

var MyFunc = function () {
    this._name = "vinoth";
    this.setName = function(name){
        this._name = name;
    };
    this.$get = function () {        
        return "Hello from MyFunc.$get(). this.name = " + this._name;
    };    
};

// returns the output of the function's $get function
app.provider('myProv', MyFunc);

app.config(function(myProvProvider){
    myProvProvider.setName("vijay");
});

app.controller('MyCtrl', function MyCtrl($scope, myProv) {
    $scope.providerOutput = "myProvider = " + myProv;
});