Created
February 5, 2013 18:56
-
-
Save rbpasker/4716707 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
Backbone.Cloudant.database = "/sandbox/"; | |
// start the change handler | |
// Backbone.Cloudant.changeHandler(); | |
PersonView = Backbone.View.extend({ | |
initialize: function () { | |
this.render(); | |
}, | |
template: _.template($("#person_template").html()), | |
render: function() { | |
this.$el.html(this.template(this.model.attributes)); | |
return this; | |
} | |
} | |
); | |
var all_docs = new Backbone.Cloudant.Docs.Collection(); | |
var all_docs_view = new PersonView({collection: all_docs, id: '#person_template'}); | |
all_docs.fetch().fail(function(){console.log('Could not load all_docs collection');}); |
This file contains hidden or 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
<script src="jquery/jquery-1.9.0.full.js"></script> | |
<script src="underscore/underscore-1.4.4.full.js"></script> | |
<script src="backbone/backbone-0.9.10.full.js"></script> | |
<script src="cloudant/backbone.cloudant-0.0.1.full.js"></script> | |
<script type="text/template" id="person_template"> | |
<input type="text" id="id" /> | |
</script> | |
HELLOW WORLD | |
<div id="person_container"></div> | |
<script src="js/app2.js"></script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment