JSFiddle - React, Tailwind, and code Playground
by Oli Gustafsson
HTML
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.5/angular.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
<!DOCTYPE html>
<html lang="sv">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>JsCollection Demo</title>
<!-- Font awesome -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body ng-app="myApp" ng-controller="myCtrl">
<div class="container">
<br />
<div class="jumbotron">
<h1>JsCollection Examplea</h1>
</div>
<div class="row">
<div class="col-md-6">
<h3>$scope.testCollection</h3>
<pre>{{collectionString}}</pre>
</div>
<div class="col-md-6">
<h3>Table demo</h3>
<table class="table table-bordered">
<thead>
...
JavaScript
var myElements = [
{
name: 'Test Test1',
id: 24,
type: {
first: 'A',
second: 'B'
}
},
{
name: 'Abba Test2',
id: 10,
type: {
first: 'C',
second: 'B'
}
},
{
name: 'Zee Test3',
id: 55,
type: {
first: 'A',
second: 'C'
}
},
{
name: 'Bentley Test4',
id: 1,
type: {
first: 'D',
second: 'D'
}
},
{
name: 'Moo says the cow',
id: 77,
type: {
first: 'F',
second: 'A'
}
}
];
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {
$scope.testCollection = new JsCollection(myElements);
$scope.collectionString = JSON.stringify($scope.testCollection, null, 2);
});