JSFiddle - React, Tailwind, and code Playground
HTML
<div ng-app>
<div ng-controller="Ctrl">
<button ng-click="setSampleData()">fetch</button>
<ul ng-if="!users">
<!-- Entries generated by php -->
<li>Marek:[email protected]</li>
<li>Konrad:[email protected]</li>
</ul>
<ul ng-if="users">
<li ng-repeat="user in users">{{user.name}}:{{user.email}}</li>
</ul>
</div>
</div>
JavaScript
function Ctrl($scope) {
$scope.users = null;
$scope.setSampleData = function () {
$scope.users = [
{'name': "John", 'email': "[email protected]"},
{'name': "Bob", 'email': "[email protected]"}
]
};
}