{"id":228135,"date":"2014-07-01T13:47:02","date_gmt":"2014-07-01T09:47:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=228135"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=228135","title":{"rendered":"<span class=\"post_title\">Ribs.js \u2014 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b, \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c\u044b\u0435 \u043f\u043e\u043b\u044f \u0438 \u0431\u0438\u043d\u0434\u0438\u043d\u0433\u0438 \u0434\u043b\u044f Backbone.js<\/span>"},"content":{"rendered":"<div class=\"content html_format\">     \t<a href=\"http:\/\/habrahabr.ru\/company\/mailru\/blog\/228135\/\"><img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/0eb\/d63\/de0\/0ebd63de0251d5479959ee0dd275cfad.jpg\"\/><\/a><\/p>\n<p>  \u041f\u0440\u0438\u0432\u0435\u0442! \u041c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 \u0412\u0430\u043b\u0435\u0440\u0438\u0439 \u0417\u0430\u0439\u0446\u0435\u0432, \u044f \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u0430\u0439\u0434-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043f\u0440\u043e\u0435\u043a\u0442\u0430 <a href=\"https:\/\/target.mail.ru\/\">\u0422\u0430\u0440\u0433\u0435\u0442 Mail.ru<\/a>. \u0412 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043d\u0435\u0431\u0435\u0437\u044b\u0437\u0432\u0435\u0441\u0442\u043d\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 Backbone.js, \u0438, \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u043d\u0430\u043c \u0441\u0442\u0430\u043b\u043e \u0447\u0435\u0433\u043e-\u0442\u043e \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u0442\u044c. \u041f\u043e\u0440\u0430\u0437\u043c\u044b\u0441\u043b\u0438\u0432 \u043d\u0430\u0434 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u043c\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u044f\u043c\u0438 \u043d\u0430\u0448\u0438\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c, \u044f \u0440\u0435\u0448\u0438\u043b \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0435 \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043a Backbone.js, \u043a\u0430\u043a \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u0441\u044f \u0441 \u0431\u043b\u044d\u043a\u0434\u0436\u0435\u043a\u043e\u043c \u0438\u2026 \u041e \u043d\u0435\u043c \u044f \u0438 \u0445\u043e\u0447\u0443 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435.<\/p>\n<p>  <a href=\"https:\/\/github.com\/ZaValera\/backbone.ribs\">Ribs.js<\/a> \u2014 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430, \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u044e\u0449\u0430\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 Backbone. \u0418 \u043f\u0440\u0435\u043b\u0435\u0441\u0442\u044c \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u0442, \u0430 \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0430\u0448 \u043b\u044e\u0431\u0438\u043c\u044b\u0439 Backbone, \u043a\u0430\u043a \u0438 \u043f\u0440\u0435\u0436\u0434\u0435, \u043d\u043e \u043f\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0437\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438:  <\/p>\n<ul>\n<li>\u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b: \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u043c\u0438 \u043c\u043e\u0434\u0435\u043b\u0438 \u043b\u044e\u0431\u043e\u0439 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0441\u0442\u0438;<\/li>\n<li>\u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c\u044b\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b: \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0432 \u043c\u043e\u0434\u0435\u043b\u044c \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0435\u0440\u0435\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043f\u0440\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 (\u0434\u0440\u0443\u0433\u0438\u0445 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 \u043c\u043e\u0434\u0435\u043b\u0438);<\/li>\n<li>\u0431\u0438\u043d\u0434\u0438\u043d\u0433\u0438: \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0441\u0432\u044f\u0437\u044c \u043c\u0435\u0436\u0434\u0443 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u043c\u0438 \u043c\u043e\u0434\u0435\u043b\u0438 \u0438 DOM-\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c\u0438.<\/li>\n<\/ul>\n<p>  \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u044d\u0442\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h1>\u0412\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b<\/h1>\n<p>\u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u0441\u0430\u043c\u043e\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0438 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e\u0433\u043e. \u0415\u0441\u043b\u0438 \u0432\u044b \u043c\u043d\u043e\u0433\u043e \u043f\u0438\u0448\u0435\u0442\u0435 \u043d\u0430 Backbone, \u0442\u043e \u043d\u0430\u0432\u0435\u0440\u043d\u044f\u043a\u0430 \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u043b\u0438\u0441\u044c \u0441 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439, \u043a\u043e\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u0432\u043d\u0435\u0441\u0442\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u043c\u043e\u0434\u0435\u043b\u044c, \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0434\u0430\u043b\u0435\u043a\u043e \u043d\u0435 \u043f\u043b\u043e\u0441\u043a\u0438\u0435.  <\/p>\n<pre><code class=\"javascript\">var Simpsons = Backbone.Ribs.Model.extend({     defaults: {         homer: {             age: 40,             weight: 90,             job: 'Safety Inspector'         },         bart: {             age: 10,             weight: 30,             job: '4th grade student'         }     } });  var family = new Simpsons(); <\/code><\/pre>\n<p>  \u041f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, \u0447\u0442\u043e \u0413\u043e\u043c\u0435\u0440 \u043f\u043b\u043e\u0442\u043d\u043e \u043f\u043e\u043e\u0431\u0435\u0434\u0430\u043b \u0438 \u043d\u0430\u0431\u0440\u0430\u043b \u043f\u0430\u0440\u0443 \u043a\u0438\u043b\u043e\u0433\u0440\u0430\u043c\u043c\u043e\u0432:<\/p>\n<p>  <b>Backbone:<\/b>  <\/p>\n<pre><code class=\"javascript\">var homer = _.clone(family.get('homer'));  homer.weight = 92; family.set('homer', homer); <\/code><\/pre>\n<p>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u043d\u0430\u0440\u0443\u0448\u0430\u0442\u044c get\/set \u043f\u043e\u0434\u0445\u043e\u0434, \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e:  <\/p>\n<ol>\n<li>\u0437\u0430\u0431\u0440\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442 \u0438\u0437 \u043c\u043e\u0434\u0435\u043b\u0438;<\/li>\n<li>\u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043a\u043e\u043f\u0438\u044e \u044d\u0442\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430;<\/li>\n<li>\u0432\u043d\u0435\u0441\u0442\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f;<\/li>\n<li>\u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c \u043e\u0431\u0440\u0430\u0442\u043d\u043e.<\/li>\n<\/ol>\n<p>  \u0421\u043e\u0433\u043b\u0430\u0441\u0438\u0442\u0435\u0441\u044c, \u044d\u0442\u043e \u043a\u0440\u0430\u0439\u043d\u0435 \u043d\u0435\u0443\u0434\u043e\u0431\u043d\u043e. \u0410 \u0435\u0441\u043b\u0438 \u0443\u0447\u0435\u0441\u0442\u044c \u0442\u043e\u0442 \u0444\u0430\u043a\u0442, \u0447\u0442\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043e\u0433\u0440\u043e\u043c\u043d\u044b\u043c\u0438, \u0442\u043e \u044d\u0442\u043e \u0435\u0449\u0435 \u0438 \u043e\u0447\u0435\u043d\u044c \u0437\u0430\u0442\u0440\u0430\u0442\u043d\u043e. \u041a\u0443\u0434\u0430 \u043f\u0440\u043e\u0449\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u043e\u0442 \u0430\u0442\u0440\u0438\u0431\u0443\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0443\u0436\u043d\u043e:<\/p>\n<p>  <b>Backbone + Ribs:<\/b>  <\/p>\n<pre><code class=\"javascript\">family.set('homer.weight', 92); <\/code><\/pre>\n<p>  \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u044d\u0442\u043e\u0433\u043e set-a \u0431\u0443\u0434\u0435\u0442 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u0435 <code>'change:homer.weight'<\/code>. \u041d\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0430 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f, \u043a\u043e\u0433\u0434\u0430 \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0431\u044b\u043b\u0438 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u043f\u043e \u0432\u0441\u0435\u0439 \u0446\u0435\u043f\u043e\u0447\u043a\u0435 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0441\u0442\u0438. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0443 set \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c <code>{propagation: true}<\/code>.  <\/p>\n<pre><code class=\"javascript\">family.set('homer.weight', 92, {propagation: true}); <\/code><\/pre>\n<p>  \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0431\u0443\u0434\u0443\u0442 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u0441\u043e\u0431\u044b\u0442\u0438\u044f <code>'change:homer.weight'<\/code> \u0438 <code>'change:homer'<\/code>.<\/p>\n<h1>\u0412\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c\u044b\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b<\/h1>\n<p>\u0421\u0440\u0430\u0437\u0443 \u043e\u0433\u043e\u0432\u043e\u0440\u044e\u0441\u044c, \u0447\u0442\u043e \u044f \u043f\u0440\u0438\u0432\u044b\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0438\u0445 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c\u044b\u043c\u0438 \u043f\u043e\u043b\u044f\u043c\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u043e\u0448\u0443 \u043c\u0435\u043d\u044f \u0438\u0437\u0432\u0438\u043d\u0438\u0442\u044c \u0437\u0430 \u0434\u0432\u043e\u0439\u043d\u0443\u044e \u0442\u0435\u0440\u043c\u0438\u043d\u043e\u043b\u043e\u0433\u0438\u044e. \u0418\u0442\u0430\u043a, \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c. \u041e\u0447\u0435\u043d\u044c \u0447\u0430\u0441\u0442\u043e \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f, \u043a\u043e\u0433\u0434\u0430 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u043c\u043e\u0434\u0435\u043b\u0438 \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u0443\u044e \u0444\u043e\u0440\u043c\u0443 (\u043d\u0430\u0437\u043e\u0432\u0435\u043c \u0435\u0435 \u00ab\u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u00bb), \u0430 \u043f\u043e\u0442\u043e\u043c \u044d\u0442\u043e\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c, \u0434\u0430 \u0435\u0449\u0435 \u0438 \u043d\u0435 \u0432 \u043e\u0434\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435. \u0418 \u0445\u043e\u0440\u043e\u0448\u043e \u0431\u044b, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432, \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u043b\u0441\u044f, \u0438 \u0432\u0441\u0451, \u0447\u0442\u043e \u043d\u0430 \u043d\u0435\u0433\u043e \u0437\u0430\u0432\u044f\u0437\u0430\u043d\u043e, \u0442\u043e\u0436\u0435 \u0431\u044b \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u043b\u043e\u0441\u044c. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0433\u0440\u043e\u043c\u043e\u0437\u0434\u043a\u0430\u044f \u0432\u0435\u0440\u0435\u043d\u0438\u0446\u0430 \u0438\u0437 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0438 \u043f\u043e\u0434\u043f\u0438\u0441\u043e\u043a, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043c \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u0442\u0438\u0447\u043d\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c.<\/p>\n<p>  \u041a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, \u041f\u0440\u043e\u0444\u0435\u0441\u0441\u043e\u0440 \u0424\u0440\u0438\u043d\u043a \u0437\u0430\u0434\u0443\u043c\u0430\u043b \u043d\u0435\u043a\u043e\u0435 \u0431\u0435\u0437\u0443\u043c\u043d\u043e\u0435 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0435\u043c\u0443 \u043e\u0447\u0435\u043d\u044c \u0432\u0430\u0436\u043d\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u0449\u0438\u0439 \u0432\u0435\u0441 \u0413\u043e\u043c\u0435\u0440\u0430 \u0438 \u0411\u0430\u0440\u0442\u0430. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u0440\u0430\u0432\u043d\u0438\u043c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0430 \u0447\u0438\u0441\u0442\u043e\u043c Backbone \u0438 \u043d\u0430 Backbone + Ribs.<\/p>\n<p>  <b>Backbone:<\/b>  <\/p>\n<pre><code class=\"javascript\">var Simpsons = Backbone.Model.extend({     defaults: {         homer: {             age: 40,             weight: 90,             job: 'Safety Inspector'         },         bart: {             age: 10,             weight: 30,             job: '4th grade student'         }     } });  var family = new Simpsons(),     doSmth = function (model, value) {         console.log(value);     };  family.on('change:bart', function (model, bart) {     var prev = family.previous('bart').weight;      if (bart.weight !== prev) {         doSmth(family, bart.weight + family.get('homer').weight);     } });  family.on('change:homer', function (model, homer) {     var prev = family.previous('homer').weight;      if (homer.weight !== prev) {         doSmth(family, homer.weight + family.get('bart').weight);     } });  var bart = _.clone(family.get('bart'));  bart.weight = 32; family.set('bart', bart);\/\/\u0412 \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0432\u0435\u0434\u0435\u043d\u043e: 122  var homer = _.clone(family.get('homer'));  homer.weight = 91; family.set('homer', homer);\/\/\u0412 \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0432\u0435\u0434\u0435\u043d\u043e: 123 <\/code><\/pre>\n<p>  \u041c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e-\u0434\u0440\u0443\u0433\u043e\u043c\u0443, \u043d\u043e \u044d\u0442\u043e \u043d\u0435 \u0441\u0438\u043b\u044c\u043d\u043e \u0441\u043f\u0430\u0441\u0435\u0442 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044e. \u0420\u0430\u0437\u0431\u0435\u0440\u0435\u043c, \u0447\u0442\u043e \u043c\u044b \u0437\u0434\u0435\u0441\u044c \u043f\u043e\u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0438. \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043b\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0447\u0442\u043e-\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0441 \u0438\u0441\u043a\u043e\u043c\u044b\u043c \u0441\u0443\u043c\u043c\u0430\u0440\u043d\u044b\u043c \u0432\u0435\u0441\u043e\u043c. \u041f\u043e\u0434\u043f\u0438\u0441\u0430\u043b\u0438\u0441\u044c \u043d\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 <code>'change:homer'<\/code> \u0438 <code>'change:bart'<\/code>. \u0412 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u0445 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c, \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u043e\u0441\u044c \u043b\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432\u0435\u0441\u0430, \u0438 \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u043d\u0430\u0448\u0443 \u0440\u0430\u0431\u043e\u0447\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e. \u0421\u043e\u0433\u043b\u0430\u0441\u0438\u0442\u0435\u0441\u044c, \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043c\u043d\u043e\u0433\u043e \u043f\u0438\u0441\u0430\u043d\u0438\u043d\u044b \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0438 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u043d\u043e\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438. \u0422\u0435\u043f\u0435\u0440\u044c \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435, \u043d\u043e \u043a\u043e\u0440\u043e\u0447\u0435, \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u0435\u0435 \u0438 \u043f\u0440\u043e\u0449\u0435.<\/p>\n<p>  <b>Backbone + Ribs:<\/b>  <\/p>\n<pre><code class=\"javascript\">var Simpsons = Backbone.Ribs.Model.extend({     defaults: {         homer: {             age: 40,             weight: 90,             job: 'Safety Inspector'         },         bart: {             age: 10,             weight: 30,             job: '4th grade student'         }     },      computeds: {         totalWeight: {             deps: ['homer.weight', 'bart.weight'],             get: function (h, b) {                 return h + b;             }         }     } });  var family = new Simpsons(),     doSmth = function (model, value) {         console.log(value);     };  family.on('change:totalWeight', doSmth);  family.set('bart.weight', 32); \/\/\u0412 \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0432\u0435\u0434\u0435\u043d\u043e: 122 family.set('homer.weight', 91); \/\/\u0412 \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0432\u0435\u0434\u0435\u043d\u043e: 123 <\/code><\/pre>\n<p>  \u0427\u0442\u043e \u0436\u0435 \u0437\u0434\u0435\u0441\u044c \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442?! \u041c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c\u043e\u0435 \u043f\u043e\u043b\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0434\u0432\u0443\u0445 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432. \u041f\u0440\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u043a\u0430\u043a\u043e\u0433\u043e-\u043b\u0438\u0431\u043e \u0438\u0437 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432, \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c\u043e\u0435 \u043f\u043e\u043b\u0435 \u043f\u0435\u0440\u0435\u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438. \u0412\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c\u044b\u0439 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c, \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u0430\u0442\u0440\u0438\u0431\u0443\u0442.<\/p>\n<p>  \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0435\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435:  <\/p>\n<pre><code class=\"javascript\">family.get('totalWeight'); \/\/ 120 <\/code><\/pre>\n<p>  \u041c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0434\u043f\u0438\u0441\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0435\u0433\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435:  <\/p>\n<pre><code class=\"javascript\">family.on('change:totalWeight', function () {}); <\/code><\/pre>\n<p>  \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438, \u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434 set \u0434\u043b\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c\u043e\u0433\u043e \u043f\u043e\u043b\u044f, \u0438 \u0441\u0435\u0442\u0438\u0442\u044c \u0435\u0433\u043e \u0431\u0435\u0437 \u0437\u0430\u0437\u0440\u0435\u043d\u0438\u044f \u0441\u043e\u0432\u0435\u0441\u0442\u0438. \u0421\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c\u044b\u0435 \u043f\u043e\u043b\u044f \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u0445 \u0434\u0440\u0443\u0433\u0438\u0445 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c\u044b\u0445 \u043f\u043e\u043b\u0435\u0439. \u0422\u0430\u043a\u0436\u0435, \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c\u044b\u0435 \u043f\u043e\u043b\u044f \u043e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u044b \u0432 \u0431\u0438\u043d\u0434\u0438\u043d\u0433\u0430\u0445!<\/p>\n<h1>\u0411\u0438\u043d\u0434\u0438\u043d\u0433\u0438<\/h1>\n<p>\u0411\u0438\u043d\u0434\u0438\u043d\u0433 \u2014 \u044d\u0442\u043e \u0441\u0432\u044f\u0437\u044c \u043c\u0435\u0436\u0434\u0443 \u043c\u043e\u0434\u0435\u043b\u044c\u044e \u0438 DOM-\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u043c. \u041f\u0440\u043e\u0449\u0435 \u0442\u0443\u0442 \u0438 \u043d\u0435 \u0441\u043a\u0430\u0436\u0435\u0448\u044c. \u0412\u0435\u0431-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0443 \u0438\u0437\u043e \u0434\u043d\u044f \u0432 \u0434\u0435\u043d\u044c \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u0432\u0441\u044f\u043a\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441. \u0421\u043b\u0435\u0434\u0438\u0442\u044c \u0437\u0430 \u0438\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u043c\u0438. \u041e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c. \u0421\u043d\u043e\u0432\u0430 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c\u2026 \u0410 \u0442\u0443\u0442 \u0443\u0436\u0435 \u0438 \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u0434\u0435\u043d\u044c \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b\u0441\u044f. \u0412\u0435\u0440\u043d\u0435\u043c\u0441\u044f \u043a \u043d\u0430\u0448\u0438\u043c \u0436\u0435\u043b\u0442\u044b\u043c \u0434\u0440\u0443\u0437\u044c\u044f\u043c. \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u0437\u0430\u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u043d\u0430\u043c \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u0441\u0443\u043c\u043c\u0430\u0440\u043d\u044b\u0439 \u0432\u0435\u0441 \u0432 \u043a\u0430\u043a\u043e\u0439-\u043d\u0438\u0431\u0443\u0434\u044c <code>span<\/code>.<\/p>\n<p>  <b>Backbone:<\/b>  <\/p>\n<pre><code class=\"javascript\">var Simpsons = Backbone.Model.extend({     defaults: {         homer: {             age: 40,             weight: 90,             job: 'Safety Inspector'         },         bart: {             age: 10,             weight: 30,             job: '4th grade student'         }     } });  var Table = Backbone.View.extend({     initialize: function (family) {         this.family = family;          family.on('change:bart', function (model, bart) {             var prev = this.family.previous('bart').weight;              if (bart.weight !== prev) {                 this.onchangeTotalWeight(bart.weight + family.get('homer').weight);             }         }, this);          family.on('change:homer', function (model, homer) {             var prev = family.previous('homer').weight;              if (homer.weight !== prev) {                 this.onchangeTotalWeight(homer.weight + family.get('bart').weight);             }         }, this);     },      onchangeTotalWeight: function (totalWeight) {         this.$('span').text(totalWeight);     } });  var family = new Simpsons(),     table = new Table(family); <\/code><\/pre>\n<p>  <b>Backbone + Ribs:<\/b>  <\/p>\n<pre><code class=\"javascript\">var Simpsons = Backbone.Ribs.Model.extend({     defaults: {         homer: {             age: 40,             weight: 90,             job: 'Safety Inspector'         },         bart: {             age: 10,             weight: 30,             job: '4th grade student'         }     },      computeds: {         totalWeight: {             deps: ['homer.weight', 'bart.weight'],             get: function (h, b) {                 return h + b;             }         }     } });  var Table = Backbone.Ribs.View.extend({     bindings: {         'span': {text: 'family.totalWeight'}     },      initialize: function (family) {         this.family = family;     } });  var family = new Simpsons(),     table = new Table(family); <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c, \u043f\u0440\u0438 \u043b\u044e\u0431\u044b\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u0445 \u0432\u0435\u0441\u0430 \u0413\u043e\u043c\u0435\u0440\u0430 \u0438\u043b\u0438 \u0411\u0430\u0440\u0442\u0430, <code>span<\/code> \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d. \u041f\u043e\u043c\u0438\u043c\u043e \u0442\u0435\u043a\u0441\u0442\u0430, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u0432\u044f\u0437\u0438 \u043c\u0435\u0436\u0434\u0443 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 DOM-\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u043c\u0438 \u043c\u043e\u0434\u0435\u043b\u0435\u0439:  <\/p>\n<ul>\n<li>\u0434\u0432\u0443\u0441\u0442\u043e\u0440\u043e\u043d\u043d\u044f\u044f \u0441\u0432\u044f\u0437\u044c \u0441 input-\u0430\u043c\u0438 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432 (text, checkbox, radio);<\/li>\n<li>css-\u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430;<\/li>\n<li>css-\u043a\u043b\u0430\u0441\u0441\u044b;<\/li>\n<li>\u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u044b;<\/li>\n<li>\u0438 \u0434\u0440\u0443\u0433\u043e\u0435.<\/li>\n<\/ul>\n<p>  \u041f\u043e\u043c\u0438\u043c\u043e \u043e\u0431\u044b\u0447\u043d\u044b\u0445 \u0431\u0438\u043d\u0434\u0438\u043d\u0433\u043e\u0432 \u0432 Ribs.js \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c <b>\u0431\u0438\u043d\u0434\u0438\u043d\u0433 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438<\/b>. \u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430 \u0437\u0430\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u0435\u0442 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u0432 \u0434\u0432\u0443\u0445 \u0441\u043b\u043e\u0432\u0430\u0445. \u0411\u0438\u043d\u0434\u0438\u043d\u0433 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u0435\u0442 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044e \u043c\u043e\u0434\u0435\u043b\u0435\u0439, Backbone.View \u0438 \u043d\u0435\u043a\u0438\u0439 DOM-\u044d\u043b\u0435\u043c\u0435\u043d\u0442. \u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u0438\u0437 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u0441\u0432\u043e\u0439 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 View \u0438 \u043a\u043b\u0430\u0434\u0435\u0442\u0441\u044f \u0432 DOM-\u044d\u043b\u0435\u043c\u0435\u043d\u0442. \u041f\u0440\u0438\u0447\u0435\u043c \u043f\u0440\u0438 \u043b\u044e\u0431\u044b\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u0445 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 (\u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435\/\u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0435\u0439, \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430) \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0431\u0435\u0437 \u0432\u0430\u0448\u0435\u0433\u043e \u0432\u043c\u0435\u0448\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0430. \u0422\u0435\u043c \u0441\u0430\u043c\u044b\u043c \u0432\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0435 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0432\u0441\u0435\u0439 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438. \u041e\u0431\u043b\u0430\u0441\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u0430 \u2014 \u0440\u0430\u0437\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u044b\u0435 \u0441\u043f\u0438\u0441\u043a\u0438 \u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0441 \u043e\u0434\u043d\u043e\u0442\u0438\u043f\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438.<\/p>\n<h1>\u041f\u043e\u0447\u0435\u043c\u0443 \u0438\u043c\u0435\u043d\u043d\u043e Ribs.js, \u0430 \u043d\u0435 \u0447\u0442\u043e-\u0442\u043e \u0434\u0440\u0443\u0433\u043e\u0435?<\/h1>\n<p>\u041d\u0430 \u043f\u0440\u043e\u0441\u0442\u043e\u0440\u0430\u0445 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430 \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u0440\u044f\u0434 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441\u043e \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u043c\u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u043c\u0438. \u0415\u0441\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0442 \u0431\u0438\u043d\u0434\u0438\u043d\u0433\u0438. \u041d\u043e \u044d\u0442\u043e \u0440\u0430\u0437\u043d\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0438 \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0438\u0445 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0432\u043c\u0435\u0441\u0442\u0435 \u2014 \u0437\u0430\u0434\u0430\u0447\u0430 \u043e\u0447\u0435\u043d\u044c \u043d\u0435\u043f\u0440\u043e\u0441\u0442\u0430\u044f, \u0430 \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u043d\u0435\u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c\u0430\u044f.<\/p>\n<p>  \u0422\u0440\u0438 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0435 Ribs.js (\u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b, \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c\u044b\u0435 \u043f\u043e\u043b\u044f \u0438 \u0431\u0438\u043d\u0434\u0438\u043d\u0433\u0438) \u043c\u043e\u0433\u0443\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u0434\u0440\u0443\u0433 \u043e\u0442 \u0434\u0440\u0443\u0433\u0430. \u041d\u043e \u0432\u0441\u044f \u043c\u043e\u0449\u044c \u0440\u0430\u0441\u043a\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u043a\u043e\u0433\u0434\u0430 \u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 \u0438\u0445 \u0432\u043c\u0435\u0441\u0442\u0435 (\u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u044d\u0442\u043e \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e \u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442).<\/p>\n<p>  \u0411\u043b\u0438\u0436\u0430\u0439\u0448\u0438\u0439 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0439 \u043c\u043d\u0435 \u043a\u043e\u043d\u043a\u0443\u0440\u0435\u043d\u0442 \u2014 Epoxy.js. \u042d\u0442\u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0441\u043e \u0441\u0445\u043e\u0436\u0438\u043c\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u043c\u0438, \u043d\u043e:  <\/p>\n<ul>\n<li>\u043e\u043d\u0430 \u043d\u0435 \u0443\u043c\u0435\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u043c\u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u043c\u0438, \u0430 \u044d\u0442\u043e, \u043a\u0430\u043a \u043c\u044b \u0443\u0436\u0435 \u0443\u0431\u0435\u0434\u0438\u043b\u0438\u0441\u044c, \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u0430\u044f \u0432\u0435\u0449\u044c;<\/li>\n<li>\u043e\u0434\u043d\u0443 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044e \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043e\u0434\u043d\u043e\u043c \u0431\u0438\u043d\u0434\u0438\u043d\u0433\u0435 (\u0432 Ribs.js \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430 \u0431\u0430\u0437\u0435 \u043e\u0434\u043d\u043e\u0439 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0443\u0433\u043e\u0434\u043d\u043e \u0440\u0430\u0437\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u044b\u0445 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0439);<\/li>\n<li>\u0432 \u0442\u0435\u0441\u0442\u0435 \u0441 \u0431\u0438\u043d\u0434\u0438\u043d\u0433\u043e\u043c \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 \u0438\u0437 10000 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 Epoxy.js \u0443\u0441\u0442\u0443\u043f\u0430\u0435\u0442 Ribs.js \u043f\u043e\u0447\u0442\u0438 \u0432 2 \u0440\u0430\u0437\u0430. \u0418\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 \u0442\u0435\u0441\u0442\u0430 \u043b\u0435\u0436\u0430\u0442 <a href=\"https:\/\/github.com\/ZaValera\/backbone.ribs\/tree\/master\/epoxyVSribs\">\u0437\u0434\u0435\u0441\u044c<\/a>;<\/li>\n<li>\u0435\u0441\u0442\u044c \u0435\u0449\u0435 \u0440\u044f\u0434 \u043f\u0440\u0438\u0434\u0438\u0440\u043e\u043a \u043a \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f. \u0412 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447\u0430\u0445 \u0438\u0437-\u0437\u0430 \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432\u044b\u0434\u0443\u043c\u044b\u0432\u0430\u0442\u044c \u043e\u0431\u0445\u043e\u0434\u043d\u044b\u0435 \u043f\u0443\u0442\u0438 \u0438 \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u043a\u043e\u0441\u0442\u044b\u043b\u0438.<\/li>\n<\/ul>\n<p>  \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f Ribs.js, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u043e\u0441\u0440\u0435\u0434\u043e\u0442\u043e\u0447\u0438\u0442\u044c\u0441\u044f \u043d\u0430 \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0435, \u043d\u0435 \u043e\u0442\u0432\u043b\u0435\u043a\u0430\u044f\u0441\u044c \u043d\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0438\u0445 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u043e\u0432. \u041a\u043e\u0434 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u0435\u0435 \u0438 \u043a\u043e\u043c\u043f\u0430\u043a\u0442\u043d\u0435\u0435, \u0430 \u044d\u0442\u043e \u0441\u0430\u043c\u044b\u043c \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u043d\u0430 \u0441\u0430\u043c\u043e\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435, \u0442\u0430\u043a \u0438 \u043d\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0435. \u041a \u0442\u043e\u043c\u0443 \u0436\u0435, \u0440\u0430\u0431\u043e\u0442\u0430 \u043d\u0430\u0434 Ribs.js \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0430. \u041c\u043d\u043e\u0433\u0438\u0435 \u0438\u0434\u0435\u0438, \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0432 Ribs.js \u0440\u043e\u0434\u0438\u043b\u0438\u0441\u044c \u0432 \u0445\u043e\u0434\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0430\u0434 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0431\u043e\u0435\u0432\u044b\u043c\u0438 \u0437\u0430\u0434\u0430\u0447\u0430\u043c\u0438. \u042d\u0442\u0438 \u0438\u0434\u0435\u0438 \u0431\u0443\u0434\u0443\u0442 \u043f\u043e\u044f\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0434\u0430\u043b\u044c\u0448\u0435, \u0438 \u043b\u0443\u0447\u0448\u0438\u0435 \u0438\u0437 \u043d\u0438\u0445 \u0431\u0443\u0434\u0443\u0442 \u043f\u043e\u043f\u0430\u0434\u0430\u0442\u044c \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438.      \t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/company\/mailru\/blog\/228135\/\"> http:\/\/habrahabr.ru\/company\/mailru\/blog\/228135\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">     \t<a href=\"http:\/\/habrahabr.ru\/company\/mailru\/blog\/228135\/\"><img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/0eb\/d63\/de0\/0ebd63de0251d5479959ee0dd275cfad.jpg\"\/><\/a><\/p>\n<p>  \u041f\u0440\u0438\u0432\u0435\u0442! \u041c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 \u0412\u0430\u043b\u0435\u0440\u0438\u0439 \u0417\u0430\u0439\u0446\u0435\u0432, \u044f \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u0430\u0439\u0434-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043f\u0440\u043e\u0435\u043a\u0442\u0430 <a href=\"https:\/\/target.mail.ru\/\">\u0422\u0430\u0440\u0433\u0435\u0442 Mail.ru<\/a>. \u0412 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043d\u0435\u0431\u0435\u0437\u044b\u0437\u0432\u0435\u0441\u0442\u043d\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 Backbone.js, \u0438, \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u043d\u0430\u043c \u0441\u0442\u0430\u043b\u043e \u0447\u0435\u0433\u043e-\u0442\u043e \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u0442\u044c. \u041f\u043e\u0440\u0430\u0437\u043c\u044b\u0441\u043b\u0438\u0432 \u043d\u0430\u0434 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u043c\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u044f\u043c\u0438 \u043d\u0430\u0448\u0438\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c, \u044f \u0440\u0435\u0448\u0438\u043b \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0435 \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043a Backbone.js, \u043a\u0430\u043a \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u0441\u044f \u0441 \u0431\u043b\u044d\u043a\u0434\u0436\u0435\u043a\u043e\u043c \u0438\u2026 \u041e \u043d\u0435\u043c \u044f \u0438 \u0445\u043e\u0447\u0443 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435.<\/p>\n<p>  <a href=\"https:\/\/github.com\/ZaValera\/backbone.ribs\">Ribs.js<\/a> \u2014 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430, \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u044e\u0449\u0430\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 Backbone. \u0418 \u043f\u0440\u0435\u043b\u0435\u0441\u0442\u044c \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u0442, \u0430 \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0430\u0448 \u043b\u044e\u0431\u0438\u043c\u044b\u0439 Backbone, \u043a\u0430\u043a \u0438 \u043f\u0440\u0435\u0436\u0434\u0435, \u043d\u043e \u043f\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0437\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438:  <\/p>\n<ul>\n<li>\u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b: \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u043c\u0438 \u043c\u043e\u0434\u0435\u043b\u0438 \u043b\u044e\u0431\u043e\u0439 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0441\u0442\u0438;<\/li>\n<li>\u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c\u044b\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b: \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0432 \u043c\u043e\u0434\u0435\u043b\u044c \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0435\u0440\u0435\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043f\u0440\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 (\u0434\u0440\u0443\u0433\u0438\u0445 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 \u043c\u043e\u0434\u0435\u043b\u0438);<\/li>\n<li>\u0431\u0438\u043d\u0434\u0438\u043d\u0433\u0438: \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0441\u0432\u044f\u0437\u044c \u043c\u0435\u0436\u0434\u0443 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u043c\u0438 \u043c\u043e\u0434\u0435\u043b\u0438 \u0438 DOM-\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c\u0438.<\/li>\n<\/ul>\n<p>  \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u044d\u0442\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-228135","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/228135","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=228135"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/228135\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=228135"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=228135"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=228135"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}