Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2016
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. var bookmark = {
  2. id: 'id',
  3. description: 'description',
  4. notes: 'notes'
  5. }
  6.  
  7. this.bookmark = ko.observable();
  8.  
  9. this.bookmark.subscribe = function(bookmarkWithNewNotes) {
  10. //use the bookmarkWithNewNotes.id to update the bookmark in the db
  11. }
  12.  
  13. this.bookmark(ko.mapping.fromJS(existingBookmark));
  14.  
  15. <div databind="with: $root.bookmark" >
  16. Notes
  17. <textarea class="userNotes" rows="10" data-bind="value: notes" ></textarea>
  18. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement