JSFiddle - React, Tailwind, and code Playground

by mchrobok

HTML

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.1.5/angular.min.js"></script>
<div ng-controller="ctrl">{{value}}</div>

JavaScript

angular.module('ngApp', [])

.service('service', function ($http, $timeout) {
    var t = this;
    this.data={"somedata":0};
    $timeout(function() {
        t.data.somedata = t.data.somedata + 1;             
    }, 5000);
    
})
 
.controller('ctrl', function ($scope, service) {
    $scope.service = service;
    $scope.$watch('service.data.somedata', function (newValue) {
        $scope.value = newValue;
    });
    
});