{"id":15620320,"url":"https://github.com/passy/backbone.datalink","last_synced_at":"2025-04-28T13:34:47.535Z","repository":{"id":2875927,"uuid":"3881943","full_name":"passy/backbone.datalink","owner":"passy","description":"Wrapper around Synapse for easy data binding between models and views.","archived":false,"fork":false,"pushed_at":"2020-03-27T05:41:36.000Z","size":37,"stargazers_count":5,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-25T02:12:41.478Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"CoffeeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/passy.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"MIT-LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-03-30T23:42:58.000Z","updated_at":"2013-11-28T06:38:09.000Z","dependencies_parsed_at":"2022-08-30T22:02:03.765Z","dependency_job_id":null,"html_url":"https://github.com/passy/backbone.datalink","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/passy%2Fbackbone.datalink","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/passy%2Fbackbone.datalink/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/passy%2Fbackbone.datalink/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/passy%2Fbackbone.datalink/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/passy","download_url":"https://codeload.github.com/passy/backbone.datalink/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242496585,"owners_count":20138438,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-03T09:01:11.672Z","updated_at":"2025-03-08T03:30:30.646Z","avatar_url":"https://github.com/passy.png","language":"CoffeeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"=================\nBackbone.DataLink\n=================\n\n.. image:: https://secure.travis-ci.org/passy/backbone.datalink.png?branch=master\n    :alt: Travis CI build status\n    :target: http://travis-ci.org/#!/passy/backbone.datalink\n\nSimple wrapper around Synapse to keep data between your Backbone models and\nviews in sync.\n\nRequirements\n============\n\n`Synapse \u003chttp://bruth.github.com/synapse/docs/\u003e`_ must be installed and\nconfigured with both the jQuery and Backbone Model hook.\n\nInstallation\n============\n\nThe library itself can be installed via the `volo \u003chttp://volojs.org/\u003e`_\npackage manager::\n\n    volo add passy/backbone.datalink\n\nAlternatively, you can grab the latest version here:\n\n* `Uncompressed \u003chttps://raw.github.com/passy/backbone.datalink/master/dist/backbone.datalink.js\u003e`_\n* `Uglified \u003chttps://raw.github.com/passy/backbone.datalink/master/dist/backbone.datalink.min.js\u003e`_\n\nBackbone.DataLink supports the `UMD \u003chttps://github.com/umdjs/umd\u003e`_ and can be\nloaded in CommonJS environments, via AMD and as traditional browser script.\n\n::\n\n    require(['synapse', 'synapse/jquery', 'synapse/backbone-model', 'datalink'],\n        function (Synapse, JQueryHook, BackboneModelHook, DataLink) {\n            Synapse.hooks = [Synapse, JQueryHook, BackboneModelHook];\n        }\n    )\n\nExample\n=======\n\nTo sync the elements title and description of your model with the\ncorresponding input fields in your rendered view, add this after your\nrendering is done::\n\n    datalink.linkView(this, ['title', 'description'])\n\nYour template may look like this::\n\n    \u003cinput data-bind=title\u003e\n    \u003ctextarea data-bind=description\u003e\n\nTo override the default settings, provide a hash as third parameter::\n\n    datalink.linkView(this, ['title', 'description'], {prefill: false})\n\nTo override certain settings for specific elements, provide a fourth parameter::\n\n    datalink.linkView(this, ['title', 'description'], {prefill: true}, {\n        'title': {attribute: \"name\"},\n        'description': {prefill: false}\n    })\n\nOptions\n=======\n\n* ``bind``, default ``syncWith``\n    * Binding function. One of 'syncWith', 'observe' or 'notify'.\n* ``attribute``, default ``data-bind``\n    * HTML attribute to look for to map model attributes.\n* ``ignoreEmpty``, default ``false``\n    * If false, raises an exception if an element could not be bound.\n* ``prefill``, default ``true``\n    * Fill observed elements with model data on load.\n* ``triggerOnBind``, default ``false``\n    * Fire change event after binding.\n\nAlternatives\n============\n\nThere are some projects with similar goals:\n\n* `Backbone.ModelBinder \u003chttps://github.com/theironcook/Backbone.ModelBinder\u003e`_\n* `backbone.modelbinding \u003chttps://github.com/derickbailey/backbone.modelbinding\u003e`_\n\nLicense\n=======\n\nDual licensed under the MIT or GPL Version 3 licenses.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpassy%2Fbackbone.datalink","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpassy%2Fbackbone.datalink","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpassy%2Fbackbone.datalink/lists"}