JSFiddle - React, Tailwind, and code Playground

by James Allardice

HTML

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.1.4/angular.js"></script>
<ul ng-app="test" ng-controller="TestCtrl">
    <li ng-repeat="x in arr" ng-init="t=getDate()">{{getDate()}} and {{t}} {{arr[$index]}}</li>
</ul>

JavaScript

var t = angular.module("test", []);

t.controller("TestCtrl", function ($scope, $timeout) {

    $scope.arr = [
        "elem1",
        "elem2",
        "elem3"
    ];
    
    $scope.getDate = function () {
        return +new Date();
    };
    
    $timeout(function () {
        $scope.arr[2] = "< I should have a different timestamp to the two above me now";
    }, 2000);
});