The bare minimum AngularJS
Just really simple of AngularJS as a jsFiddle
HTML
<script src="http://code.angularjs.org/1.2.10/angular-animate.js"></script>
<div ng-app="myAppModule" ng-controller="someController">
<table>
<tr data-ng-repeat="line in chat">
<td class="message-timestamp">{{line.time | date:'short'}}</td>
<td class="message-nick">
<div ng-if="line.type === 'gist'">{{line.nick}}</div>
<div ng-if="lin.type !== 'gist'"><span class="glyphicon glyphicon-arrow-right"></span></div>
</td>
<td class="message-text">
<div ng-if="line.type === 'gist'">
<p>
<code ng-show="showGist" walrus-auto-gistify data-gist-id="{{line.options[0]}}"></code>
<br />
<button ng-click="showGist = !showGist" class="btn btn-primary btn-xs">Show/Hide</button>
</p>
</div>
<div ng-if="line.type !== 'gist'">
{{line.message}}
</div>
</td>
</tr>
</table>
</div>
<script>
</script>
JavaScript
var myApp = angular.module('myAppModule', []);
myApp.controller('someController', function($scope) {
// do some stuff here
$scope.showGist = true;
$scope.chat = [ {
'time': '4/7/2015 4:41',
'type': 'gist',
'nick': 'Steve',
'message': 'Hey, whats up?'
}, {
'time': '4/7/2015 4:42',
'type': 'notGist',
'nick': 'JD',
'message': 'Hey, whats up?'
}
]
});