JSFiddle - React, Tailwind, and code Playground

by jteve code

HTML

<!-- index.html -->
<html ng-app='fruitApp'>
	<head>
		<title>ng-repeat test</title>
	</head>
	<body ng-controller='bodyController'>
		<table>
			<tr ng-repeat='fruit in fruits'>
				<td>{{$index}}</td>
				<td><a href='/fruit/view/{{fruit.id}}'>{{fruit.name}}</a></td>				
			</tr>
		<table>
		<br>
		<button ng-click="insertButton()"> insert item </button>
		<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.2/angular.min.js"></script>
		<script>
			var app = angular.module('fruitApp',[]);
			var __function = function($scope){
				$scope.fruits = [
				{name:'banana', id:1},
				{name:'apple', id:2}
				];
				$scope.insertButton = function(){
					$scope.fruits.splice(0,0,{name:'jteve', id:'4'});
				}
			}
			app.controller('bodyController',__function);
		</script>
	</body>
</html>