loopback/example/browser/index.html

84 lines
2.4 KiB
HTML

<!doctype html>
<html lang="en" ng-app>
<head>
<meta charset="utf-8">
<title>My AngularJS App</title>
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.0/css/bootstrap.min.css"/>
<link rel="stylesheet" href="app.css"/>
</head>
<body>
<h1 ng-controller="NetworkCtrl">
<input style="font-size: 48px;" type="checkbox" ng-model="network.available" />Online
</h1>
<ul ng-controller="ReplicationCtlr">
<button ng-click="replicate()">Push</button>
<button ng-click="replicateFromRemote()">Pull</button>
<h2 ng-show="conflicts.length">Conflicts:</h2>
<li ng-repeat="conflict in conflicts">
<button ng-click="conflict.resolve()">Use local {{conflict.source.name}}</button>
<button ng-click="resolveUsingRemote(conflict)">Use remote {{conflict.target.name}}</button>
</li>
</ul>
<ul ng-controller="ListCtrl">
<li ng-repeat="color in colors" style="color: {{color.name}}">
<form ng-submit="color.save()">
<input placeholder="{{color.name}}" ng-model="color.name" />
{{color.conflict}}
<a href="#" ng-click="color.destroy()">delete</a>
</form>
</li>
<li>
<form ng-submit="add()">
<input placeholder="enter a color" ng-model="newColor" />
</form>
</li>
</ul>
<h1>Local Changes</h1>
<table ng-controller="ChangeCtrl">
<thead>
<th>type</th>
<th>rev</th>
<th>prev</th>
<th>base</th>
<th>checkpoint</th>
<th>modelId</th>
</thead>
<tr ng-repeat="change in changes">
<td>{{change.type()}}</h3>
<td>{{change.rev}}</td>
<td>{{change.prev}}</td>
<td>{{change.base}}</td>
<td>{{change.checkpoint}}</td>
<td>{{change.modelId}}</td>
</tr>
</table>
<h1>Remote Changes</h1>
<table ng-controller="RemoteChangeCtrl">
<thead>
<th>type</th>
<th>rev</th>
<th>prev</th>
<th>base</th>
<th>checkpoint</th>
<th>modelId</th>
</thead>
<tr ng-repeat="change in changes">
<td>{{change.type()}}</h3>
<td>{{change.rev}}</td>
<td>{{change.prev}}</td>
<td>{{change.base}}</td>
<td>{{change.checkpoint}}</td>
<td>{{change.modelId}}</td>
</tr>
</table>
<script src="loopback.js"></script>
<script src="loopback-remote-models.js"></script>
<script src="client.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.1/angular.min.js"></script>
</body>
</html>