JSFiddle - React, Tailwind, and code Playground

by samonela

HTML

<div ng-app="mainApp">
  <div ng-controller="AddStudentController">
    <table class="table table-bordered">
      <thead>
        <tr>
          <th>Id</th>
          <th>Name</th>
          <th>Email</th>
          <th>Created At</th>
        </tr>
      </thead>
      <tbody>
        <tr ng-repeat="data in datas">
          <td>@{{ data.id }}</td>
          <td>@{{ data.name }}</td>
          <td>@{{ data.email }}</td>
          <td>@{{ data.created_at }}</td>
        </tr>
      </tbody>
    </table>
    <div id="messageContainer">
    {{ message }}
    </div>
  </div>

JavaScript

var mainApp = angular.module("mainApp", []);
mainApp.controller('AddStudentController', function($scope) {
  $scope.message = 'this is a message';
    /*$http.get('getusers').then( function(response) {
      $scope.datas = response.data;
    });*/
    setTimeout(function() {
    console.log('setting datas; $scope: ', $scope.message);
    	$scope.datas = [{
      'id': 1,
      'name': 'Sam',
      'email': '[email protected]',
      'created_at': '1999-01-01'
      }];
      $scope.message = 'updated mesage';
      console.log('updated message: ', $scope.message);
    }, 2000);
  });