Skip to content

Instantly share code, notes, and snippets.

@kranack
Created January 15, 2016 16:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kranack/acead43d18115236bfa6 to your computer and use it in GitHub Desktop.
Save kranack/acead43d18115236bfa6 to your computer and use it in GitHub Desktop.
Home Template
<ion-view view-title="Home">
<ion-content class="padding">
<p>Pas de colocation pour le moment</p>
<form>
<legend>Add A book to the Collection:</legend>
<label for="newBookTitle">Title</label>
<input type="text" ng-model="title" id="newBookTitle">
<label for="newBookDescription">Description</label>
<input type="text" ng-model="description" id="newBookDescription">
<button ng-click="books.$add({title: title, description: description})">Add</button>
</form>
<h5>The Library:</h5>
<table>
<thead>
<tr>
<th>Title</th>
<th>Description</th>
<th></th>
</tr>
</thead>
<tbody>
<tr ng-repeat="book in books">
<td><input ng-model="book.title"></td>
<td><input ng-model="book.description"></td>
<td>
<button ng-click="books.$update(book)">Update</button>
<button ng-click="books.$remove(book)">Remove</button>
</td>
</tr>
</tbody>
</table>
<h3>3. Enable a 4-way binding by running a CouchDb instance</h3>
<p> The CouchDb database should have CORS enabled.<br>
$scope.sync is configured for <a href="http://localhost:5984/_utils">http://localhost:5984/_utils</a> in app.js
</p>
<P>
4-way binding with Remote Syncing: <a href="#/home" ng-click="toggleOnline()">{{!online ? 'disabled' : 'enabled' }}</a><p>
</P>
</ion-content>
</ion-view>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment