JSFiddle - React, Tailwind, and code Playground

by jhoguet

HTML

<div ng-app="myApp" ng-controller="childController">
    <h1>{{child.fullName}}</h1>
    <p>{{child.fullName}} is {{child.age}} years old and loves <em>{{child.toy}}</em></p>
    <button ng-click="child.incrementAge()">+</button>
</div>

JavaScript

angular.module('myApp', [])
.controller('childController', function ($scope) {
        $scope.child = {
            fullName : 'Lance Hoguet',
            age : 2,
            toy : 'Trains',
            incrementAge : function(){
                this.age++;
            }
        }
        
        setInterval(function(){
            $scope.child.incrementAge();
            $scope.$digest();
        }, 100);
});