-
-
Save kranack/acead43d18115236bfa6 to your computer and use it in GitHub Desktop.
Home Template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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