JSFiddle - React, Tailwind, and code Playground

by spechackers

HTML

<div ng-app="myApp" ng-controller="TestCtrl as test">
    <h1>Welcome {{test.getName()}}, last time you logged in was {{test.getLastLoggedInTime()}}!</h1>
</div>

JavaScript

//JS
(function(ng, app){
    app = angular.module('myApp', []);
    
    app.config(function($provide) {
        $provide.value('user', {
            username: "vinoth",
            locale : "en-us",
            timeStamp: new Date()
        });
    });
    
    app.controller('TestCtrl', [
        'user',
        function MainCtrl(user) {
            this.getName = function() {
                return user.username;
            };
            
            this.getLastLoggedInTime = function() {
                return user.timeStamp;
            };
        }
    ]);
}(angular));