{"id":221703,"date":"2014-05-04T18:22:02","date_gmt":"2014-05-04T14:22:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=221703"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=221703","title":{"rendered":"<span class=\"post_title\">\u0418\u0437\u0443\u0447\u0430\u0435\u043c Derby 0.6, \u043f\u0440\u0438\u043c\u0435\u0440 #2<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t<img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/fd8\/eb0\/5a8\/fd8eb05a89c50e810f0daf8f6b54731a.png\" alt=\"todos\"\/><\/p>\n<p>  \u042d\u0442\u043e\u0442 \u043f\u043e\u0441\u0442 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u0435 \u0441\u0435\u0440\u0438\u0438, \u043d\u0430\u0447\u0430\u0442\u043e\u0439 <a href=\"http:\/\/habrahabr.ru\/post\/221027\/\">\u0437\u0434\u0435\u0441\u044c<\/a>. \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c, \u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0439, \u00ab\u0441\u043f\u0438\u0441\u043e\u043a \u0434\u0435\u043b\u00bb (Todo-<br \/>  list \u0438\u0437 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 <a href=\"http:\/\/todomvc.com\/\">TodoMVC<\/a>). \u0417\u0430 \u043e\u0441\u043d\u043e\u0432\u0443 \u0432\u043e\u0437\u044c\u043c\u0435\u043c \u0432\u0430\u0440\u0438\u043d\u0442, <a href=\"http:\/\/todomvc.com\/architecture-examples\/angularjs\/#\/\">\u0441\u0434\u0435\u043b\u0430\u043d\u043d\u044b\u0439 \u043d\u0430 Angular<\/a>, \u0438 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0432\u043e\u0441\u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u043d\u0430 <a href=\"http:\/\/derbyjs.com\/\">derby<\/a>.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h4>\u0418\u0441\u0441\u043b\u0435\u0434\u0443\u0435\u043c \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442<\/h4>\n<p>  \u0418\u0442\u0430\u043a, \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0432 \u0430\u043d\u0433\u0443\u043b\u044f\u0440\u043e\u0432\u0441\u043a\u043e\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0435, \u0438 \u043a\u0430\u043a \u043e\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 (\u043f\u043e\u0438\u0433\u0440\u0430\u0439\u0442\u0435\u0441\u044c \u0441\u0430\u043c\u0438 \u2014 \u0432\u0441\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435):<\/p>\n<ul>\n<li>\u043d\u043e\u0432\u0430\u044f \u0437\u0430\u0434\u0447\u0430 \u0432\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0432\u0435\u0440\u0445\u043d\u0435\u043c \u043f\u043e\u043b\u0435 \u0432\u0432\u043e\u0434\u0430, \u0432 \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u043e\u043f\u0430\u0434\u0430\u0435\u0442 \u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043d\u0430 <code>enter<\/code><\/li>\n<li>\u043b\u044e\u0431\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443 \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 \u043c\u043e\u0436\u043d\u043e \u0443\u0434\u0430\u043b\u0438\u0442\u044c, \u043a\u043b\u0438\u043a\u043d\u0443\u0432 \u043d\u0430 \u00ab\u043a\u0440\u0435\u0441\u0442\u0438\u043a\u00bb \u0441\u043f\u0440\u0430\u0432\u0430 \u043e\u0442 \u0437\u0430\u0434\u0430\u0447\u0438 (\u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f, \u0435\u0441\u043b\u0438 \u043d\u0430\u0432\u0435\u0441\u0442\u0438 \u043c\u044b\u0448\u043a\u0443 \u043d\u0430 \u0437\u0430\u0434\u0430\u0447\u0443)<\/li>\n<li>\u0437\u0430\u0434\u0430\u0447\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043c\u0435\u0447\u0430\u0442\u044c \u043a\u0430\u043a \u00ab\u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u044b\u0435\u00bb, \u043a\u043b\u0438\u043a\u043d\u0443\u0432 \u043d\u0430 \u00ab\u0433\u0430\u043b\u043e\u0447\u043a\u0443\u00bb \u0441\u043b\u0435\u0432\u0430 \u043e\u0442 \u0437\u0430\u0434\u0430\u0447\u0438 (\u043e\u0442\u043c\u0435\u0442\u043a\u0443 \u043c\u043e\u0436\u043d\u043e \u0441\u043d\u0438\u043c\u0430\u0442\u044c)<\/li>\n<li>\u043f\u0440\u0438 \u0434\u0432\u043e\u0439\u043d\u043e\u043c \u043a\u043b\u0438\u043a\u0435 \u043c\u044b\u0448\u043a\u043e\u0439 \u043d\u0430 \u0437\u0430\u0434\u0430\u0447\u0435, \u043e\u043d\u0430 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442 \u0432 \u0440\u0435\u0436\u0438\u043c \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u043f\u0440\u0438\u0432\u0438\u043c, \u0436\u043c\u0435\u043c enter \u2014 \u043e\u043d\u0430 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442\u0441\u044f<\/li>\n<li>\u0435\u0441\u043b\u0438 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u044b\u0435 \u0437\u0430\u0434\u0430\u0447\u0438, \u0441\u043f\u0440\u0430\u0432\u0430 \u0441\u043d\u0438\u0437\u0443 \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u043d\u043e\u043f\u043a\u0430 \u00abclear completed\u00bb, \u0435\u0441\u043b\u0438 \u043d\u0430\u0436\u0430\u0442\u044c \u043d\u0430 \u043d\u0435\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u044b\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u0443\u0434\u0430\u043b\u044f\u0442\u0441\u044f<\/li>\n<li>\u0432\u0435\u0434\u0435\u0442\u0441\u044f \u043f\u043e\u0434\u0441\u0447\u0435\u0442 (\u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044f) \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u044b\u0445 \u0438 \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447. \u0421\u043d\u0438\u0437\u0443 \u0432 \u0441\u0442\u0430\u0442\u0443\u0441\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435<\/li>\n<li>\u0442\u0430\u043a \u0436\u0435 \u0441\u043d\u0438\u0437\u0443, \u0432 \u0441\u0442\u0430\u0442\u0443\u0441\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0435\u0441\u0442\u044c 3 \u0441\u0441\u044b\u043b\u043a\u0438 (all, active, completed, \u043c\u0435\u043d\u044f\u044e\u0449\u0438\u0435 url \u043d\u0430 &#8216;#\/&#8217;, &#8216;#\/active&#8217; \u0438 &#8216;#\/completed&#8217; \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e), \u043a\u043b\u0438\u043a\u043d\u0443\u0432 \u043f\u043e \u043d\u0438\u043c \u043c\u044b \u043c\u0435\u043d\u044f\u0435\u043c \u0444\u0438\u043b\u044c\u0442 \u0437\u0430\u0434\u0430\u0447: \u043b\u0438\u0431\u043e \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u044e\u0442\u0441\u044f \u0432\u0441\u0435 \u0437\u0430\u0434\u0430\u0447\u0438, \u043b\u0438\u0431\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0435 (\u043d\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u044b\u0435), \u043b\u0438\u0431\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u044b\u0435<\/li>\n<\/ul>\n<p>  <\/p>\n<h4>\u0427\u0442\u043e \u0432\u043e\u0437\u044c\u043c\u0435\u043c \u0437\u0430 \u043e\u0441\u043d\u043e\u0432\u0443<\/h4>\n<p>  \u0418\u0441\u0445\u043e\u0434\u044f \u0438\u0437 \u043d\u0430\u0448\u0438\u0445 \u0446\u0435\u043b\u0435\u0439 (\u0443\u0437\u043d\u0430\u0442\u044c \u043b\u0443\u0447\u0448\u0435 derbyjs), \u043c\u044b \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u0437\u0434\u0435\u0441\u044c \u043f\u0440\u0438\u0434\u0443\u043c\u044b\u0432\u0430\u0442\u044c \u0441\u0442\u0438\u043b\u0438, \u043e\u043d\u0438 \u0443\u0436\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u044b \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0431\u0435\u0437 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0439 TodoMVC. \u041f\u0440\u043e\u0441\u0442\u043e \u0432\u043e\u0437\u044c\u043c\u0435\u043c <a href=\"http:\/\/todomvc.com\/architecture-examples\/angularjs\/bower_components\/todomvc-common\/base.css\">css-\u0444\u0430\u0439\u043b<\/a>. \u0411\u0435\u0433\u043b\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434 \u043f\u043e \u043d\u0435\u043c\u0443 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u0437\u044f\u0442\u044c \u0435\u0449\u0435 \u0438 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443 \u0434\u043b\u044f \u0444\u043e\u043d\u0430 <a href=\"http:\/\/todomvc.com\/architecture-examples\/angularjs\/bower_components\/todomvc-common\/bg.png\">bg.png<\/a>. \u0422\u0430\u043a \u0436\u0435, \u0432 \u043a\u0430\u0447\u0435\u0442\u0441\u0442\u0432\u0435 \u043a\u0430\u0440\u043a\u0430\u0441\u0430 \u0432\u043e\u0437\u044c\u043c\u0435\u043c \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0430\u043d\u0433\u0443\u043b\u044f\u0440\u043e\u043c html (\u044f \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043b \u0435\u0433\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 \u0438 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0447\u0438\u0441\u0442\u0438\u043b \u043e\u0442 \u0430\u043d\u0433\u0443\u043b\u044f\u0440\u043e\u0432\u0441\u043a\u0438\u0445 \u0434\u0435\u0440\u0435\u043a\u0442\u0438\u0432).  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0411\u0430\u0437\u043e\u0432\u044b\u0439 html-\u043a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"html\">  &lt;section id=&quot;todoapp&quot;&gt;     &lt;header id=&quot;header&quot;&gt;       &lt;h1&gt;todos&lt;\/h1&gt;       &lt;form id=&quot;todo-form&quot;&gt;         &lt;input id=&quot;new-todo&quot; placeholder=&quot;What needs to be done?&quot; autofocus&quot;&gt;       &lt;\/form&gt;     &lt;\/header&gt;     &lt;section id=&quot;main&quot;&gt;       &lt;input id=&quot;toggle-all&quot; type=&quot;checkbox&quot;&gt;       &lt;label for=&quot;toggle-all&quot;&gt;Mark all as complete&lt;\/label&gt;       &lt;ul id=&quot;todo-list&quot;&gt;         &lt;li&gt;           &lt;div class=&quot;view&quot;&gt;             &lt;input class=&quot;toggle&quot; type=&quot;checkbox&quot;&gt;             &lt;label&gt;hello&lt;\/label&gt;             &lt;button class=&quot;destroy&quot;&gt; &lt;\/button&gt;           &lt;\/div&gt;           &lt;form &gt;             &lt;input class=&quot;edit&quot;&gt;           &lt;\/form&gt;         &lt;\/li&gt;       &lt;\/ul&gt;     &lt;\/section&gt;     &lt;footer id=&quot;footer&quot;&gt;       &lt;span id=&quot;todo-count&quot;&gt;&lt;strong&gt;0&lt;\/strong&gt;         &lt;span&gt;items left&lt;\/span&gt;       &lt;\/span&gt;       &lt;ul id=&quot;filters&quot;&gt;         &lt;li&gt;&lt;a href=&quot;\/&quot; class=&quot;selected&quot;&gt;All&lt;\/a&gt;&lt;\/li&gt;         &lt;li&gt;&lt;a href=&quot;\/active&quot;&gt;Active&lt;\/a&gt;&lt;\/li&gt;         &lt;li&gt;&lt;a href=&quot;\/completed&quot;&gt;Completed&lt;\/a&gt;&lt;\/li&gt;       &lt;\/ul&gt;       &lt;button id=&quot;clear-completed&quot;&gt;Clear completed (0)&lt;\/button&gt;     &lt;\/footer&gt;   &lt;\/section&gt; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e, \u043d\u0430\u0448 html \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 3-\u0445 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0431\u043b\u043e\u043a\u043e\u0432:<\/p>\n<ol>\n<li>header \u2014 \u0437\u0434\u0435\u0441\u044c \u043d\u0430\u0445\u043e\u0434\u0442\u0441\u044f \u0433\u043b\u0430\u0432\u043d\u044b\u0439 input. \u041e\u043d \u043d\u0443\u0436\u0435\u043d \u0434\u043b\u044f \u0432\u0432\u043e\u0434\u0430 \u043d\u043e\u0432\u044b\u0445 \u0437\u0430\u0434\u0430\u0447;<\/li>\n<li>main \u2014 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0431\u043b\u043e\u043a, \u0437\u0434\u0435\u0441\u044c \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0441\u0430\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u0437\u0430\u0434\u0430\u0447;<\/li>\n<li>footer \u2014 \u0441\u0442\u0430\u0442\u0443\u0441\u043d\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430, \u0437\u0434\u0435\u0441\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f, \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u043c\u0438 \u0438 \u043a\u043d\u043e\u043f\u043a\u0430 &#8216;Clear completed&#8217;<\/li>\n<\/ol>\n<h4>\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/h4>\n<p>  \u0422\u0430\u043a, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0441\u0441\u0443\u0436\u0434\u0430\u0442\u044c. \u0427\u0442\u043e \u0443 \u043d\u0430\u0441 \u0431\u0443\u0434\u0435\u0442 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435? \u0411\u0443\u0434\u0435\u0442 \u0444\u0430\u0439\u043b \u0441\u0442\u0438\u043b\u0435\u0439, \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u0434\u0430\u0447\u0430 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 (\u043a\u0430\u043a\u0440\u0442\u0438\u043d\u043a\u0438 \u0444\u043e\u043d\u0430), \u0431\u0443\u0434\u0443\u0442 html-\u0448\u0430\u0431\u043b\u043e\u043d\u044b, \u0442\u0430\u043a \u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c 2-\u0444\u0430\u0439\u043b\u0430 \u2014 \u0434\u0432\u0435 \u0447\u0430\u0441\u0442\u0438 \u0434\u0435\u0440\u0431\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f (\u0441\u0435\u0440\u0432\u0435\u0440\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c, \u0438 \u0441\u0430\u043c\u043e \u0434\u0435\u0440\u0431\u0438-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435). \u0418\u0441\u0445\u043e\u0434\u044f \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u0432\u0441\u0435\u0433\u043e, \u044f \u043d\u0430\u043a\u0438\u0434\u0430\u043b \u0442\u0430\u043a\u0443\u044e \u0444\u0430\u0439\u043b\u043e\u0432\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u044f (\u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043b\u044e\u0431\u0443\u044e \u0434\u0440\u0443\u0433\u0443\u044e):<\/p>\n<pre><code class=\"bash\">public\/   bg.png app  # \u0414\u0435\u0440\u0431\u0438-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435   views\/     index.html   css\/     index.css   index.js  # \u041a\u043e\u0434 \u0434\u0435\u0440\u0431\u0438-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f server.js  # \u0421\u0435\u0440\u0432\u0435\u0440\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0434\u0435\u0440\u0431\u0438 package.json <\/code><\/pre>\n<p>  \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0438, css-\u0444\u0430\u0439\u043b \u043b\u0435\u0436\u0438\u0442 \u0432\u043d\u0443\u0442\u0440\u0438 \u043f\u0430\u043f\u043a\u0438 app, \u0430 \u043d\u0435 \u0432\u043d\u0443\u0442\u0440\u0438 public. \u042d\u0442\u043e \u0441\u0432\u044f\u0437\u0430\u043d\u043e \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e \u0434\u0435\u0440\u0431\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u0441\u0442\u0438\u043b\u044f\u043c\u0438 \u043f\u043e \u043e\u0441\u043e\u0431\u043e\u043c\u0443. \u0412 \u0438\u0442\u043e\u0433\u0435 \u043e\u043d\u0438 \u0431\u0443\u0434\u0443\u0442 \u0431\u0443\u0434\u0443\u0442 \u0432\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0432 head \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0432 \u0442\u0435\u0433\u0438 style \u2014 \u043a\u0430\u043a \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0438 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f google-\u0430 (\u0441\u043e \u0441\u043b\u043e\u0432 \u0441\u043e\u0437\u0434\u0430\u0442\u0435\u043b\u0435\u0439 derby) \u2014 \u044d\u0442\u043e \u043b\u0443\u0447\u0448\u0438\u0439 \u043f\u043e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0441\u043f\u043e\u0441\u043e\u0431 \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u0441\u0442\u0438\u043b\u0435\u0439.<\/p>\n<p>  \u0418\u0442\u0430\u043a, \u043a\u0430\u043a \u044f \u0443\u0436\u0435 \u0433\u043e\u0432\u043e\u0440\u0438\u043b \u0432 \u043f\u0440\u043e\u0448\u043b\u043e\u043c \u0443\u0440\u043e\u043a\u0435, \u0432\u0441\u0435 \u0447\u0442\u043e \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043f\u0430\u043f\u043a\u0435 app \u2014 <a href=\"http:\/\/habrahabr.ru\/post\/203444\/\">\u0438\u0437\u043e\u043c\u043e\u0440\u0444\u043d\u043e\u0435<\/a> \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435-\u0434\u0435\u0440\u0431\u0438. \u0421\u043b\u043e\u0432\u0430 \u00ab\u0438\u0437\u043e\u043c\u043e\u0440\u0444\u043d\u043e\u0435\u00bb \u043c\u043d\u0435 \u043d\u0435 \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u0438 \u044f \u0435\u0433\u043e \u0431\u0443\u0434\u0443 \u043e\u043f\u0443\u0441\u043a\u0430\u0442\u044c, \u0431\u0443\u0434\u0443 \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u0435\u0440\u0431\u0438-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432 \u043f\u0440\u043e\u0442\u0438\u0432\u043e\u043f\u043e\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043a \u00ab\u0441\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0434\u0435\u0440\u0431\u0438\u00bb. \u0421\u043c\u044b\u0441\u043b \u0437\u0434\u0435\u0441\u044c \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0432\u0441\u0435 \u044d\u0442\u0438 \u0444\u0430\u0439\u043b\u044b \u0432\u043c\u0435\u0441\u0442\u0435 (\u0432\u0441\u0435 \u0447\u0442\u043e \u0432 app), \u0435\u0434\u0438\u043d\u044b\u043c \u0431\u0430\u043d\u0434\u043b\u043e\u043c (\u043a\u0443\u0441\u043a\u043e\u043c) \u0431\u0443\u0434\u0443\u0442 \u043e\u0442\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u043e\u043c\u0443 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0443, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0438\u0445 \u0432\u043c\u0435\u0441\u0442\u0435 \u0438 \u043f\u043e\u043b\u043e\u0436\u0438\u043b. <\/p>\n<p>  \u0412\u043e\u043e\u0431\u0449\u0435 (\u043d\u0430 \u0431\u0443\u0434\u0443\u0449\u0435\u0435), \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u0431\u0438\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442 \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u0435\u0440\u0431\u0438-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0438 \u0430\u0434\u043c\u0438\u043d\u043a\u0430. \u042d\u0442\u043e \u043e\u043f\u0440\u0430\u0432\u0434\u0430\u043d\u043e \u043f\u043e \u0434\u0432\u0443\u043c \u043f\u0440\u0438\u0447\u0438\u043d\u0430\u043c, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u043e\u0442\u0434\u0430\u0432\u0430\u0442\u044c \u043b\u0438\u0448\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 (\u0448\u0430\u0431\u043b\u043e\u043d\u044b, \u0441\u0442\u0438\u043b\u0438, \u043a\u043e\u0434), \u0438 \u0447\u0442\u043e\u0431\u044b \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u044c \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u043e\u0441\u0442\u044c. \u0422\u043e \u0435\u0441\u0442\u044c \u0431\u0443\u0434\u0435\u0442 \u0442\u0430\u043a: \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0431\u0443\u0434\u0435\u0442 \u043e\u0434\u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u0435\u0440\u0431\u0438-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 (\u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0434\u0432\u0430).<\/p>\n<p>  \u0412 \u0444\u0430\u0439\u043b\u0435 package.json \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0431\u0443\u0434\u0443\u0442 \u0432\u0441\u0435 \u0442\u0435 \u0436\u0435 \u0434\u0432\u0430 \u043c\u043e\u0434\u0443\u043b\u044f: derby@0.6.0-alpha5 \u0438 derby-starter.<\/p>\n<h4>\u041d\u0430\u0447\u0438\u043d\u0430\u0435\u043c<\/h4>\n<p>  \u0421\u043e\u0437\u0434\u0435\u043c \u0444\u0430\u0439\u043b\u043e\u0432\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443. \u0424\u043e\u043d\u043e\u0432\u0443\u044e \u043a\u0430\u0440\u0442\u0438\u043a\u0443 \u0438 \u0441\u0442\u0438\u043b\u0438 \u043a\u0430\u0447\u0430\u0435\u043c \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0430\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f \u0443\u043a\u0430\u0437\u0430\u043b \u0432\u043d\u0430\u0447\u0430\u043b\u0435, package.json \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 <code>npm init<\/code> (\u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u0443\u0440\u043e\u043a\u0435).<\/p>\n<p>  Html \u043d\u0435\u043c\u043d\u043e\u0436\u043a\u043e \u043f\u043e\u0434\u043f\u0440\u0430\u0432\u0438\u043c, \u0432\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u043a\u0430\u043a \u0438 \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435, \u043e\u043d \u0434\u043e\u043b\u0436\u0435\u043d \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u043f\u0440\u0435\u0434\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u043c \u0448\u0430\u0431\u043b\u043e\u043d\u0435 <code>Body:<\/code>, \u0432\u043e-\u0432\u0442\u043e\u0440\u044b\u0445 \u0432\u044b\u043d\u0435\u0441\u0435\u043c header, main \u0438 footer \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 derby-\u0448\u0430\u0431\u043b\u043e\u043d\u044b. <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0418\u0442\u043e\u0433\u043e\u0432\u044b\u0439 index.html<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"html\">&lt;Body:&gt;   &lt;section id=&quot;todoapp&quot;&gt;     &lt;view name=&quot;header&quot;\/&gt;     &lt;view name=&quot;main&quot;\/&gt;     &lt;view name=&quot;footer&quot;\/&gt;   &lt;\/section&gt;    &lt;header:&gt;   &lt;header id=&quot;header&quot;&gt;     &lt;h1&gt;todos&lt;\/h1&gt;     &lt;form id=&quot;todo-form&quot;&gt;       &lt;input id=&quot;new-todo&quot; placeholder=&quot;What needs to be done?&quot; autofocus&quot;&gt;     &lt;\/form&gt;   &lt;\/header&gt;  &lt;main:&gt;   &lt;section id=&quot;main&quot;&gt;     &lt;input id=&quot;toggle-all&quot; type=&quot;checkbox&quot;&gt;     &lt;label for=&quot;toggle-all&quot;&gt;Mark all as complete&lt;\/label&gt;     &lt;ul id=&quot;todo-list&quot;&gt;       &lt;li&gt;         &lt;div class=&quot;view&quot;&gt;           &lt;input class=&quot;toggle&quot; type=&quot;checkbox&quot;&gt;           &lt;label&gt;hello&lt;\/label&gt;           &lt;button class=&quot;destroy&quot;&gt; &lt;\/button&gt;         &lt;\/div&gt;         &lt;form &gt;           &lt;input class=&quot;edit&quot;&gt;         &lt;\/form&gt;       &lt;\/li&gt;     &lt;\/ul&gt;   &lt;\/section&gt;  &lt;footer:&gt;   &lt;footer id=&quot;footer&quot;&gt;       &lt;span id=&quot;todo-count&quot;&gt;&lt;strong&gt;0&lt;\/strong&gt;         &lt;span&gt;items left&lt;\/span&gt;       &lt;\/span&gt;     &lt;ul id=&quot;filters&quot;&gt;       &lt;li&gt;&lt;a href=&quot;\/&quot; class=&quot;selected&quot;&gt;All&lt;\/a&gt;&lt;\/li&gt;       &lt;li&gt;&lt;a href=&quot;\/active&quot;&gt;Active&lt;\/a&gt;&lt;\/li&gt;       &lt;li&gt;&lt;a href=&quot;\/completed&quot;&gt;Completed&lt;\/a&gt;&lt;\/li&gt;     &lt;\/ul&gt;     &lt;button id=&quot;clear-completed&quot;&gt;Clear completed (0)&lt;\/button&gt;   &lt;\/footer&gt;  <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u041a\u0430\u043a \u0432\u044b \u043c\u043e\u0433\u043b\u0438 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0432\u044b\u0437\u043e\u0432 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0442\u0435\u0433\u0430 <code>view<\/code>, \u0433\u0434\u0435 \u0432 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0435 <code>name<\/code>, \u0437\u0430\u0434\u0430\u0435\u0442\u0441\u044f \u0438\u043c\u044f \u0448\u0430\u0431\u043b\u043e\u043d\u0430.<\/p>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430, \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0439 \u043a\u043e\u0434, \u0447\u0442\u043e\u0431\u044b \u0438\u043c\u0435\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0432\u0438\u0434\u0435\u0442\u044c \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0438 \u043d\u0430\u0440\u0430\u0449\u0438\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b.<\/p>\n<p>  \u0424\u0430\u0439\u043b server.js \u0438\u0437 \u043f\u0440\u043e\u0448\u043b\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d, \u0447\u0442\u043e\u0431\u044b \u0443\u0447\u0435\u0441\u0442\u044c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0438 \u043e\u0442\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0444\u0430\u0439\u043b\u044b.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">server.js<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"javascript\">var server = require('derby-starter');  var appPath = __dirname + '\/app';  var options = {   static: __dirname + '\/public' };  server.run(appPath, options); <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u041d\u0430\u043f\u043e\u043c\u043d\u044e, \u0447\u0442\u043e \u0438\u0437-\u0437\u0430 \u0443\u0447\u0435\u0431\u043d\u043e\u0439 \u043f\u0440\u0438\u0440\u043e\u0434\u044b \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438, \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043c\u043e\u0434\u0443\u043b\u044c derby-starter. \u0415\u0441\u043b\u0438 \u0437\u0430\u0433\u043b\u044f\u043d\u0443\u0442\u044c \u0432\u043d\u0443\u0442\u0440\u044c, \u0442\u043e \u043e\u0442\u0434\u0430\u0447\u0430 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u0442\u0430\u043c \u2014 \u044d\u0442\u043e \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0438\u0441\u043f\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 express-\u043e\u0432\u0441\u043a\u043e\u0433\u043e static-middlware. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 <a href=\"https:\/\/github.com\/codeparty\/derby-starter\/blob\/master\/lib\/server.js#L72-L81\">\u0441\u0430\u043c\u0438<\/a>.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 index.js:<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"javascript\">var derby = require('derby'); var app = module.exports = derby.createApp('todos', __filename);  \/\/ \u0414\u0435\u043b\u0430\u0435\u043c app \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0439, \u0447\u0442\u043e\u0431\u044b \u0438\u043c\u0435\u0442\u044c \u043a \u043d\u0435\u0439 \u0434\u043e\u0441\u0442\u0443\u043f \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0435 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430 \/\/ (\u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438) global.app = app;  app.loadViews (__dirname+'\/views'); app.loadStyles(__dirname+'\/css');  app.get('\/', getTodos);  function getTodos(page, model){   page.render(); } <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u0412\u0441\u0435, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c npm start (\u0438\u043b\u0438 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e node server.js), \u0432\u0438\u0434\u0438\u043c \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 <a href=\"http:\/\/localhost:3000\/\">http:\/\/localhost:3000\/<\/a> \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/bc7\/a9a\/489\/bc7a9a489da4b06126a76ccd674b54d8.png\"\/><\/p>\n<p>  \u0421\u0442\u0438\u043b\u0438 \u0441 \u0432\u0435\u0440\u0441\u0442\u043a\u043e\u0439 \u043f\u043e\u0434\u0446\u0435\u043f\u0438\u043b\u0438\u0441\u044c. \u041d\u0430\u0447\u0430\u043b\u043e \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043e.<\/p>\n<h4>\u041f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u0443\u0435\u043c url<\/h4>\n<p>  \u0412 \u043f\u0440\u043e\u0448\u043b\u043e\u043c \u0443\u0440\u043e\u043a\u0435 \u044f \u0433\u043e\u0432\u043e\u0440\u0438\u043b, \u0447\u0442\u043e \u0434\u0435\u0440\u0431\u0438-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0434\u043e\u043b\u0436\u0435\u043d \u043d\u0430\u0447\u0438\u043d\u0430\u0442\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0441 \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043d\u0430 url-\u0430\u0434\u0440\u0435\u0441\u0430. \u042d\u0442\u043e \u0441\u0432\u044f\u0437\u0430\u043d\u043e \u0441 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u0438\u044f\u0442\u043d\u043e\u0439 \u0432\u043e\u0437\u043c\u0436\u043d\u043e\u0441\u0442\u044e \u0434\u0435\u0440\u0431\u0438 \u2014 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u043a\u0430\u043a \u043d\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0435 \u0442\u0430\u043a \u0438 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435, \u0447\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u043b\u044e\u0431\u044f\u0442 \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u044b\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b. \u0418\u0442\u0430\u043a, \u0438\u0437\u0443\u0447\u0430\u044f \u0430\u043d\u0433\u0443\u043b\u044f\u0440\u043e\u0432\u0441\u043a\u0438\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043c\u044b \u0437\u0430\u043c\u0435\u0442\u0438\u043b\u0438, \u0447\u0442\u043e \u0432 \u0444\u0443\u0442\u0435\u0440\u0435 \u0435\u0441\u0442\u044c 3 \u0441\u0441\u044b\u043b\u043a\u0438, \u043c\u0435\u043d\u044f\u044e\u0449\u0438\u0435 url \u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0444\u0438\u043b\u044c\u0442\u0440 \u043f\u043e \u0437\u0430\u0434\u0430\u0447\u0430\u043c. \u041e\u0442\u0441\u044e\u0434\u0430 \u043c\u044b \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u043c, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c 3 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 get-\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432. \u0427\u0442\u043e-\u0442\u043e \u0442\u0438\u043f\u0430:<\/p>\n<pre><code class=\"javascript\">app.get('\/', getAllTodos); app.get('\/active', getActiveTodos); app.get('\/completed', getCompletedTodos); <\/code><\/pre>\n<p>  \u042d\u0442\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u043e\u043f\u0440\u0430\u0432\u0434\u0430\u043d\u043d\u043e, \u0435\u0441\u043b\u0438 \u0431\u044b \u0432\u0441\u0435 \u044d\u0442\u0438 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0431\u044b\u043b\u0438 \u0440\u0430\u0437\u043d\u044b\u043c\u0438, \u043d\u043e \u0443 \u043d\u0430\u0441, \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u043e\u0442\u043b\u0438\u0447\u0435\u043d\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 \u043d\u0438\u043c\u0438 \u2014 \u0444\u0438\u043b\u044c\u0442\u0440, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u0435\u043c\u0441\u044f \u043f\u043e \u043c\u0438\u043d\u0438\u043c\u0443\u043c\u0443 \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u0434.<\/p>\n<h4>\u041f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u0443\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435<\/h4>\n<p>  \u0421\u0430\u043c\u0438 \u0437\u0430\u0434\u0430\u0447\u0438 \u0443 \u043d\u0430\u0441 \u0431\u0443\u0434\u0443\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f \u0432 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 <code>todos<\/code>. \u041a\u0430\u0436\u0434\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u0430 \u0434\u0432\u0443\u043c\u044f \u043f\u043e\u043b\u044f\u043c\u0438:  <\/p>\n<ol>\n<li>text \u2014 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438<\/li>\n<li>completed \u2014 \u043f\u0440\u0438\u0437\u043d\u0430\u043a \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0437\u0430\u0434\u0430\u0447\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0430<\/li>\n<\/ol>\n<p>  \u041a \u044d\u0442\u043e\u043c\u0443 \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c, \u0447\u0442\u043e \u0443 \u043a\u0430\u0436\u0434\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u0435\u0449\u0435, \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0435 id \u2014 derby \u0434\u043e\u0431\u0430\u0432\u0438\u0442 \u0435\u0433\u043e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0440\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0432 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044e.<\/p>\n<p>  \u0418\u0442\u0430\u043a, \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u043c\u0435\u0442\u043e\u0434\u043e\u043b\u043e\u0433\u0438\u0435\u0439 \u0434\u0435\u0440\u0431\u0438, \u0432 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0435 (\u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0449\u0435\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u043a url) \u0434\u043e \u0432\u044b\u0437\u043e\u0432\u0430 render \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438 \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0438 \u043d\u0430 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445. \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a, \u0441\u0445\u0435\u043c\u0430\u0442\u0438\u0447\u043d\u043e \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a\u0438\u043c:<\/p>\n<pre><code class=\"javascript\">function getTodos(page, model){   model.subscribe('todos', function(){     page.render();   }); } <\/code><\/pre>\n<p>  \u0422\u0430\u043a \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0438 \u0431\u0443\u0434\u0435\u0442, \u043d\u043e \u043f\u0440\u0435\u0436\u0434\u0435, \u0447\u0435\u043c \u0434\u0432\u0438\u0433\u0430\u0442\u044c\u0441\u044f \u0434\u0430\u043b\u044c\u0448\u0435 (\u043a \u0442\u043e\u043c\u0443 \u0447\u0442\u043e\u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043e\u0434\u0438\u043d \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0442\u0440\u0435\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u043e\u0431\u044b \u0444\u0438\u043b\u044c\u0442\u0440\u044b \u043f\u043e \u0437\u0430\u0434\u0430\u0447\u0430\u043c \u0431\u044b\u043b\u0438 \u0440\u0430\u0437\u043d\u044b\u0435) \u043d\u0443\u0436\u043d\u043e \u0443\u0437\u043d\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0435\u0449\u0435\u0439 \u043e \u043c\u043e\u0434\u0435\u043b\u044f\u0445 \u0434\u0435\u0440\u0431\u0438:<\/p>\n<ul>\n<li>\u00ab\u043f\u0443\u0442\u0438\u00bb, \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0435\u0441\u044f \u0441 \u0441\u0438\u043c\u0432\u043e\u043b\u0430 \u043f\u043e\u0434\u0447\u0435\u0440\u043a\u0438\u0432\u0430\u043d\u0438\u044f (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, &quot;_session&quot;, &quot;_page&quot; \u0438 \u0442.\u0434.)<\/li>\n<li>\u0432 \u0447\u0435\u043c \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c &quot;_page&quot;<\/li>\n<li>\u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0432 \u0434\u0435\u0440\u0431\u0438 \u0444\u0438\u043b\u044c\u0442\u0440\u044b<\/li>\n<li>\u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 ref \u043a \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c \u0434\u0430\u043d\u043d\u044b\u043c \u0432 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438<\/li>\n<\/ul>\n<p>  \u0412 \u043f\u0440\u043e\u0448\u043b\u043e\u043c \u0443\u0440\u043e\u043a\u0435 \u044f \u0433\u043e\u0432\u043e\u0440\u0438\u043b \u043e \u0442\u0430\u043a-\u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0445 \u00ab\u043f\u0443\u0442\u044f\u0445\u00bb. \u041c\u044b \u0438\u0441\u043e\u043f\u043b\u044c\u0437\u0443\u0435\u043c \u0438\u0445 \u0432 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f\u0445 \u0441 \u043c\u043e\u0434\u0435\u043b\u044f\u043c\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u0440\u0438 \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0435 \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0435: model.subscribe(&#8216;\u043f\u0443\u0442\u044c&#8217;), \u043f\u0440\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0438 \u0438 \u043f\u0440\u0438 \u0437\u0430\u043f\u0438\u0441\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u043c\u043e\u0434\u0435\u043b\u044c: <code>model.get('\u043f\u0443\u0442\u044c')<\/code>, <code>model.set('\u043f\u0443\u0442\u044c', \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435)<\/code>. \u041f\u0440\u0438\u043c\u0435\u0440\u044b \u043f\u0443\u0442\u0435\u0439:<\/p>\n<ul>\n<li>&#8216;todos&#8217; \u2014 \u0441\u0441\u044b\u043b\u0430\u0435\u043c\u0441\u044f \u043d\u0430 \u0432\u0441\u044e \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044e todos<\/li>\n<li>&#8216;users.42&#8217; \u2014 \u0441\u0441\u044b\u043b\u0430\u0435\u043c\u0441\u044f \u043d\u0430 \u0437\u0430\u043f\u0438\u0441\u044c \u0432 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 users c id = 42<\/li>\n<\/ul>\n<p>  \u0422\u0430\u043a \u0432\u043e\u0442. \u041f\u0435\u0440\u0432\u044b\u0439 \u0441\u0435\u0440\u0433\u043c\u0435\u043d\u0442 \u043f\u0443\u0442\u0438 \u2014 \u044d\u0442\u043e, \u043a\u0430\u043a \u0432\u044b \u043f\u043e\u043d\u044f\u043b\u0438, \u0438\u043c\u044f \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438. \u042d\u0442\u043e \u0438\u043c\u044f \u0432 \u0434\u0435\u0440\u0431\u0438 \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0447\u0438\u043d\u0430\u0442\u044c\u0441\u044f \u043b\u0438\u0431\u043e \u0441 \u043b\u0430\u0442\u0438\u043d\u0441\u043a\u043e\u0439 \u0431\u0443\u043a\u0432\u044b, \u043b\u0438\u0431\u043e \u0441 \u0441\u0438\u0432\u043e\u043b\u043e\u0432 $ \u0438\u043b\u0438 _. \u0412\u0441\u0435 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438, \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0435\u0441\u044f \u0441 $ \u0438 _ \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u044b\u0435, \u043e\u043d\u0438 \u043d\u0435 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c (\u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438, \u0430 \u043c\u043e\u0434\u0435\u043b\u044c \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438-\u0434\u0435\u0440\u0431\u0438 \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u0432\u0441\u0435\u0433\u043e \u043e\u0434\u043d\u0430). \u041a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0435\u0441\u044f \u0441 $ \u0437\u0430\u0440\u0435\u0437\u0435\u0440\u0432\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u0434\u0435\u0440\u0431\u0438 \u0434\u043b\u044f \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u043d\u0443\u0436\u0434. \u041a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 \u0436\u0435, \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0435\u0441\u044f \u0441 \u0441\u0438\u043c\u0432\u043e\u043b\u0430 \u043f\u043e\u0434\u0447\u0435\u0440\u043a\u0438\u0432\u0430\u043d\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c\u0438.<\/p>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435, \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442. \u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u0438 \u043d\u0430\u0431\u0435\u0440\u0438\u0442\u0435 <code>app.model.get()<\/code> \u2014 \u043f\u043e\u0438\u0437\u0443\u0447\u0430\u0439\u0442\u0435 \u0432\u044b\u0432\u043e\u0434.<\/p>\n<p>  \u0421\u0440\u0435\u0434\u0438 &quot;_&quot;-\u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0439 \u0435\u0441\u0442\u044c \u043e\u0434\u043d\u0430 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u0430\u044f \u2014 <code>_page<\/code>, \u043e\u043d\u0430 \u0437\u0430\u0442\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u043f\u0440\u0438 \u0441\u043c\u0435\u043d\u0435 url \u2014 \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u0435\u0435 \u043e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u043e\u0439 \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0432\u0441\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0440\u0430\u0431\u043e\u0447\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445. \u0412 \u044d\u0442\u043e\u043c \u0443\u0440\u043e\u043a\u0435 \u0432\u044b \u0435\u0449\u0435 \u0443\u0432\u0438\u0434\u0438\u0442\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b.<\/p>\n<p>  \u041f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u043c. \u0415\u0441\u043b\u0438 \u0432\u044b \u0447\u0438\u0442\u0430\u043b\u0438 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u043f\u043e \u043c\u043e\u0434\u0435\u043b\u044f\u043c, \u0432\u044b \u0437\u043d\u0430\u0435\u0442\u0435, \u0447\u0442\u043e \u0432 \u0434\u0435\u0440\u0431\u0438, \u0435\u0441\u0442\u044c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u044b, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0435 \u043e\u0431\u043b\u0435\u0433\u0447\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u0440\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438. \u042d\u0442\u043e, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0440\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0438 \u043d\u0430 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u044f, \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438, \u0444\u0438\u043b\u044c\u0442\u0440\u044b-\u0434\u0430\u043d\u043d\u044b\u0445, \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u0438 \u0434\u0430\u043d\u043d\u0445.<\/p>\n<p>  \u041e\u0431\u0441\u0443\u0434\u0438\u043c \u0444\u0438\u043b\u044c\u0442\u0440\u044b. \u041a\u0430\u043a \u043d\u0430\u043c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0444\u0438\u043b\u044c\u0442\u0440, \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u0442\u043e\u043b\u044c\u043a\u043e \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0435 \u0437\u0430\u0434\u0430\u0447\u0438:<\/p>\n<p>  \u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u043c \u043f\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u043c\u0443 \u0438\u043c\u0435\u043d\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044e-\u0444\u0438\u043b\u044c\u0442\u0440 (\u0438\u043c\u044f \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0432 \u0431\u0430\u043d\u0434\u043b). \u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u0433\u043e\u0432\u043e\u0440\u0438\u0442, \u0447\u0442\u043e \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0445 \u043d\u0443\u0436\u043d\u043e \u0441\u0442\u0440\u043e\u0433\u043e \u0432 <code>app.on('model')<\/code><\/p>\n<pre><code class=\"javascript\">app.on('model', function(model) {   model.fn('completed', function(item) {      return  item.completed;   }); }); <\/code><\/pre>\n<p>  \u0418 \u0434\u0430\u043b\u0435\u0435 \u0432 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0435, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u044d\u0442\u043e\u0442 \u0444\u0438\u043b\u044c\u0442\u0440 \u0434\u043b\u044f \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0438 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 todos:<\/p>\n<pre><code class=\"javascript\">function getPage(page, model){   model.subscribe('todos', function() {     var filter = model.filter('todos', 'completed')     filter.ref('_page.todos');     page.render();   }); } <\/code><\/pre>\n<p>  \u041e\u0447\u0435\u043d\u044c \u0432\u0430\u0436\u043d\u0430 \u0437\u0434\u0435\u0441\u044c \u0441\u0442\u0440\u043e\u043a\u0430 <code>filter.ref('_page.todos');<\/code>, \u0432 \u043d\u0435\u0439 \u043e\u0442\u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u00abtodos\u00bb \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u043c \u043f\u043e \u043f\u0443\u0442\u0438 <code>_page.todos<\/code>. \u0421\u043e\u0431\u0440\u0430\u0432 \u0432\u0441\u0435 \u0432\u043c\u0435\u0441\u0442\u0435, \u044f \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434 \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432 \u0441 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430\u043c\u0438:<\/p>\n<pre><code class=\"javascript\">app.on('model', function(model) {   model.fn('all',       function(item) { return true; });   model.fn('completed', function(item) { return  item.completed;});   model.fn('active',    function(item) { return !item.completed;}); });  app.get('\/',          getPage('all')); app.get('\/active',    getPage('active')); app.get('\/completed', getPage('completed'));  function getPage(filter){   return function(, page, model){     model.subscribe('todos', function() {       model.filter('todos', filter).ref('_page.todos');       page.render();     });   } } <\/code><\/pre>\n<p>  \u041a\u0430\u043a \u0432\u044b, \u043d\u0430\u0432\u0435\u0440\u043d\u043e\u0435, \u0437\u0430\u043c\u0435\u0442\u0438\u043b\u0438, \u0447\u0442\u043e\u0431\u044b \u0432\u0441\u0435 \u0443\u043d\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0444\u0430\u043b\u044c\u0448-\u0444\u0438\u043b\u044c\u0442\u0440 \u00aball\u00bb, \u043d\u043e \u0434\u0443\u043c\u0430\u044e \u044d\u0442\u043e \u043d\u0435 \u0431\u043e\u043b\u044c\u0448\u0430\u044f \u043f\u043b\u0430\u0442\u0430 \u0437\u0430 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u0434\u0443\u0431\u043b\u0435\u0439.<\/p>\n<p>  \u041b\u0430\u0434\u043d\u043e \u043c\u044b \u043d\u0435\u043c\u043d\u043e\u0436\u043d\u043e \u043e\u0442\u0432\u043b\u0435\u043a\u043b\u0438\u0441\u044c. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043e\u0436\u0438\u0432\u0438\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435.<\/p>\n<h4>\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0438 \u0432\u044b\u0432\u043e\u0434 \u0437\u0430\u0434\u0430\u0447<\/h4>\n<p>  \u0418\u043d\u043f\u0443\u0442 \u0434\u043b\u044f \u0432\u0432\u043e\u0434\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0432\u0435\u0440\u0441\u0442\u043a\u0435 \u0443 \u043d\u0430\u0441 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"html\">    &lt;form id=&quot;todo-form&quot;&gt;       &lt;input id=&quot;new-todo&quot; placeholder=&quot;What needs to be done?&quot; autofocus&quot;&gt;     &lt;\/form&gt; <\/code><\/pre>\n<p>  \u041a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u0430\u0442\u0442\u0435\u0440\u043d \u0432 \u0434\u0435\u0440\u0431\u0438 (\u043a\u0430\u043a \u0438 \u0432\u043e \u043c\u043d\u043e\u0433\u0438\u0445 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430\u0445) \u2014 \u0440\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0435 \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u043d\u0438\u0435. \u0421\u0432\u044f\u0436\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0432\u0432\u043e\u0434\u0438\u043c\u043e\u0435 \u0432 input, \u0441 \u043a\u0430\u043a\u0438\u043c-\u043d\u0438\u0431\u0443\u0434\u044c \u043f\u0443\u0442\u0435\u043c \u0432 <code>_page<\/code>. \u0422\u0430\u043a \u0436\u0435 \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u043c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0441\u043e\u0431\u044b\u0442\u0438\u044f <code>submit<\/code> \u0444\u043e\u0440\u043c\u044b, \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043d\u0430\u0436\u0430\u043d\u0438\u0435 \u043d\u0430 <code>enter<\/code>:<\/p>\n<pre><code class=\"html\">    &lt;form id=&quot;todo-form&quot; on-submit=&quot;addTodo(_page.newTodo)&quot;&gt;       &lt;input id=&quot;new-todo&quot; placeholder=&quot;What needs to be done?&quot; autofocus value=&quot;{{_page.newTodo}}&quot;&gt;     &lt;\/form&gt; <\/code><\/pre>\n<p>  \u0412\u043c\u0435\u0441\u0442\u043e, <code>on-submit<\/code> \u043c\u044b \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043c\u043e\u0433\u043b\u0438 \u0431\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c <code>on-click<\/code>, <code>on-keyup<\/code>, <code>on-focus<\/code> \u2014 \u0442\u043e \u0435\u0441\u0442\u044c \u044d\u0442\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u0432 \u0434\u0435\u0440\u0431\u0438. \u041e\u0431\u0440\u043e\u0442\u0447\u0438\u043a \u043f\u043e\u043c\u0435\u0449\u0430\u0435\u043c \u0432 <code>app.proto<\/code> (\u043a\u043e\u0433\u0434\u0430 \u0431\u0443\u0434\u0435\u043c \u043e\u0431\u0441\u0443\u0436\u0434\u0430\u0442\u044c \u0434\u0435\u0440\u0431\u0438-\u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b, \u0443\u0432\u0438\u0434\u0435\u043c, \u0447\u0442\u043e \u043a\u0430\u0436\u0434\u0430\u044f \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u0445\u0440\u0430\u043d\u0438\u0442 \u0441\u0432\u043e\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0432 \u0441\u0435\u0431\u0435, \u043d\u043e \u043f\u043e\u043a\u0430 \u0434\u0435\u043b\u0430\u0435\u043c \u0442\u0430\u043a):<\/p>\n<pre><code class=\"javascript\">app.proto.addTodo = function(newTodo){    if (!newTodo) return;    this.model.add('todos', {     text: newTodo,     completed: false   });    this.model.set('_page.newTodo', ''); }; <\/code><\/pre>\n<p>  \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u043d\u0435 \u043f\u0443\u0441\u0442\u043e\u0439 \u043b\u0438 \u0442\u0435\u043a\u0441\u0442, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0437\u0430\u0434\u0430\u0447\u0443 \u0432 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044e, \u043e\u0447\u0438\u0449\u0430\u0435\u043c <code>input<\/code>. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0432\u044b \u0437\u0430\u043c\u0435\u0442\u0438\u043b\u0438, \u0447\u0442\u043e \u0432 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0435 \u0443 \u043d\u0430\u0441 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440, \u0435\u0441\u043b\u0438 \u0431\u044b \u043d\u0430\u043c, \u0434\u043b\u044f \u043a\u0430\u043a\u0438\u0445-\u0442\u043e \u043d\u0443\u0436\u0434, \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u043b\u0438\u0441\u044c \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u043e\u0431\u044a\u0435\u043a\u0442-\u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u0438\u043b\u0438 \u043d\u0430 \u0441\u0430\u043c html-\u044d\u043b\u0435\u043c\u0435\u043d\u0442, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u044f\u0432\u043d\u043e \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u044d\u0442\u043e \u0432 html \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c: <code>on-submit=&quot;addTodo(_page.newTodo, $event, $element)&quot;<\/code>, <code>$event<\/code> \u0438 <code>$element<\/code> \u2014 \u043e\u0441\u043e\u0431\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u0441\u0430\u043c\u0438\u043c \u0434\u0435\u0440\u0431\u0438.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0432\u044b\u0432\u043e\u0434 \u043e\u0442\u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430 \u0437\u0430\u0434\u0430\u0447 \u2014 \u043e\u0442\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0435\u043c \u043d\u0430\u0448 <code>ul<\/code>-\u044d\u043b\u0435\u043c\u0435\u043d\u0442:<\/p>\n<pre><code class=\"html\">  &lt;ul id=&quot;todo-list&quot;&gt;     {{each _page.todos as #todo, #index}}     &lt;li class=&quot;{{if #todo.completed}}completed{{\/}}&quot;&gt;        &lt;div class=&quot;view&quot;&gt;         &lt;input class=&quot;toggle&quot; type=&quot;checkbox&quot; checked=&quot;{{#todo.completed}}&quot;&gt;         &lt;label&gt;{{#todo.text}}&lt;\/label&gt;         &lt;button class=&quot;destroy&quot;&gt; &lt;\/button&gt;       &lt;\/div&gt;       &lt;form&gt;         &lt;input class=&quot;edit&quot;&gt;       &lt;\/form&gt;      &lt;\/li&gt;     {{\/each}}   &lt;\/ul&gt; <\/code><\/pre>\n<p>  \u0422\u0430\u043a, \u0447\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u043b\u0438:  <\/p>\n<ul>\n<li>\u0446\u0438\u043a\u043b\u043e\u043c \u043f\u0440\u043e\u0431\u0435\u0433\u0430\u0435\u043c\u0441\u044f \u043f\u043e \u0432\u0441\u0435\u043c todos (\u0443\u0436\u0435 \u043e\u0442\u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c) \u2014 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0434\u043b\u044f \u043d\u0438\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b-<code>li<\/code><\/li>\n<li>\u0432\u044b\u0432\u043e\u0434\u0438\u043c \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u0432 <code>lable<\/code><\/li>\n<li>\u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043b\u0438 <code>checkbox<\/code> \u043a <code>todo.completed<\/code><\/li>\n<li>\u0443 \u0442\u0435\u0433\u0430 <code>li<\/code> \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043a\u043b\u0430\u0441\u0441 <code>completed<\/code>, \u0435\u0441\u043b\u0438 \u0437\u0430\u0434\u0430\u0447\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0430.<\/li>\n<\/ul>\n<p>  <\/p>\n<h4>\u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432<\/h4>\n<p>  \u0414\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0440\u043d\u043e:<\/p>\n<pre><code class=\"html\">&lt;button class=&quot;destroy&quot; on-click=&quot;delTodo(#todo.id)&quot;&gt; &lt;\/button&gt; <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"javascript\">app.proto.delTodo = function(todoId){   this.model.del('todos.' + todoId); }; <\/code><\/pre>\n<p>  \u041f\u0440\u0438\u0447\u0435\u043c \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0435\u0449\u0435 \u043a\u043e\u0440\u043e\u0447\u0435:<\/p>\n<pre><code class=\"html\">&lt;button class=&quot;destroy&quot; on-click=&quot;model.del('todos.' + #todo.id)&quot;&gt; &lt;\/button&gt; <\/code><\/pre>\n<p>  \u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0432\u0441\u0435\u0445 \u00ab\u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u044b\u0445\u00bb \u0437\u0430\u0434\u0430\u0447 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e (\u043a\u043d\u043e\u043f\u043a\u0430 \u00abClear completed\u00bb \u0441\u043d\u0438\u0437\u0443 \u0441\u043f\u0440\u0430\u0432\u0430):<\/p>\n<pre><code class=\"html\">    &lt;button id=&quot;clear-completed&quot; on-click=&quot;clearCompleted()&quot;&gt;       Clear completed (0)     &lt;\/button&gt; <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"javascript\">app.proto.clearCompleted = function(){   var todos = this.model.get('todos');    for (var id in todos) {     if (todos[id].completed) this.model.del('todos.'+id);   } } <\/code><\/pre>\n<p>  <\/p>\n<h4>\u0420\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432<\/h4>\n<p>  \u041f\u043e \u0434\u0432\u043e\u0439\u043d\u043e\u043c\u0443 \u0449\u0435\u043b\u0447\u043a\u0443 \u043c\u044b\u0448\u0438, \u0437\u0430\u0434\u0430\u0447\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u0432 \u0440\u0435\u0436\u0438\u043c \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u0421\u0443\u0434\u044f \u043f\u043e \u0432\u0435\u0440\u0441\u0442\u043a\u0435, \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0435 \u0432 \u044d\u0442\u043e\u0442 \u0440\u0435\u0436\u0438\u043c, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043a\u043b\u0430\u0441\u0441 <code>editing<\/code> \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u043c\u0443 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0443 <code>li<\/code>. \u0422\u0430\u043a \u0436\u0435 \u043f\u043e\u043f\u0443\u0442\u043d\u043e, \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u0437\u0431\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u043e\u0442 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u043f\u0440\u0438 \u0434\u0432\u043e\u0439\u043d\u043e\u043c \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0444\u043e\u043a\u0443\u0441 \u043d\u0430 \u043d\u0443\u0436\u043d\u044b\u0439 \u043d\u0430\u043c <code>input<\/code>.<\/p>\n<p>  \u041f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c: \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0435\u043c\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435 \u0431\u0443\u0434\u0435\u043c \u0445\u0440\u0430\u043d\u0438\u0442\u044c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043f\u0443\u0442\u044c \u2014 <b>_page.edit<\/b>. \u0422\u0430\u043c \u0431\u0443\u0434\u0435\u043c \u0445\u0440\u0430\u043d\u0438\u0442\u044c id \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0435\u043c\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438, \u0438 \u0442\u0435\u043a\u0441\u0442.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0417\u0430\u0447\u0435\u043c \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0442\u0435\u043a\u0441\u0442 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e, \u043e\u043d \u0436\u0435 \u0443 \u043d\u0430\u0441 \u0443\u0436\u0435 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0432 \u0441\u0430\u043c\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435?<\/b><\/p>\n<div class=\"spoiler_text\">\u0412\u0441\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0446\u0435\u043b\u0435\u0439. \u0415\u0441\u043b\u0438 \u0431\u044b \u043c\u044b \u0441\u0432\u044f\u0437\u0430\u043b\u0438 \u0441 input-\u043e\u043c \u0442\u0435\u043a\u0441\u0442 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0438\u0437 \u0437\u0430\u0434\u0430\u0447\u0438, \u0442\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043b \u0431\u044b \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0432 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445. \u0422\u043e \u0435\u0441\u0442\u044c \u0435\u0433\u043e \u043f\u0440\u0430\u0432\u043a\u0438 (\u043a\u0430\u0436\u0434\u043e\u0435 \u043d\u0430\u0436\u0430\u0442\u0438\u0435 \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0443) \u043c\u0433\u043d\u043e\u0432\u0435\u043d\u043d\u043e \u0431\u044b \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u043b\u043e\u0441\u044c \u0443 \u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435. \u0411\u043e\u043b\u0435\u0435 \u0442\u043e\u0433\u043e, \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u043c\u043e\u0433\u043b\u0438 \u0431\u044b \u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0442\u0435\u043a\u0441\u0442 \u0438 \u0432\u0438\u0434\u0435\u0442\u044c \u0432\u0441\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f, \u043d\u043e \u044d\u0442\u043e \u043d\u0435 \u0442\u043e, \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e. \u041e\u0431\u044b\u0447\u043d\u044b\u043c \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0435\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0444\u0438\u043a\u0441\u0430\u0446\u0438\u044f \u0432 \u0431\u0430\u0437\u0435 \u043e\u043a\u043e\u043d\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0442\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u043b\u0438\u0431\u043e \u043e\u0442\u043a\u0430\u0437 \u043e\u0442 \u0444\u0438\u043a\u0441\u0430\u0446\u0438\u0438\u2026 \u0422\u043e \u0435\u0441\u0442\u044c \u0443 \u0432\u0441\u0435\u0445 \u0432\u0441\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u043e\u0433\u0434\u0430, \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043d\u0430\u0436\u0430\u043b \u043d\u0430 <code>enter<\/code>.  <\/div>\n<\/div>\n<p>  \u0418\u0442\u0430\u043a, \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u0432\u0441\u0435 \u044d\u0442\u043e:<\/p>\n<pre><code class=\"html\">  &lt;ul id=&quot;todo-list&quot;&gt;     {{each _page.todos as #todo}}     &lt;li class=&quot;{{if #todo.completed}}completed{{\/}} {{if _page.edit.id === #todo.id}}editing{{\/}}&quot;&gt;        &lt;div class=&quot;view&quot;&gt;         &lt;input class=&quot;toggle&quot; type=&quot;checkbox&quot; checked=&quot;{{#todo.completed}}&quot;&gt;         &lt;label on-dblclick=&quot;editTodo(#todo)&quot;&gt;{{#todo.text}}&lt;\/label&gt;         &lt;button class=&quot;destroy&quot; on-click=&quot;delTodo(#todo.id)&quot;&gt; &lt;\/button&gt;       &lt;\/div&gt;       &lt;form on-submit=&quot;doneEditing(_page.edit)&quot;&gt;         &lt;input id=&quot;{{#todo.id}}&quot; class=&quot;edit&quot; value=&quot;{{_page.edit.text}}&quot; on-keyup=&quot;cancelEditing($event)&quot;&gt;       &lt;\/form&gt;      &lt;\/li&gt;     {{\/each}}   &lt;\/ul&gt; <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"javascript\">app.proto.editTodo = function(todo){    this.model.set('_page.edit', {     id: todo.id,     text: todo.text   });    window.getSelection().removeAllRanges();   document.getElementById(todo.id).focus() }  app.proto.doneEditing = function(todo){   this.model.set('todos.'+todo.id+'.text', todo.text);   this.model.set('_page.edit', {     id: undefined,     text: ''   }); }  app.proto.cancelEditing = function(e){   \/\/ 27 = ESQ-key   if (e.keyCode == 27) {     this.model.set('_page.edit.id', undefined);   } } <\/code><\/pre>\n<p>  \u041f\u0440\u0438 \u0434\u0432\u043e\u0439\u043d\u043e\u043c \u0449\u0435\u043b\u0447\u043a\u0435 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044f <b>editTodo<\/b>, \u0432 \u043d\u0435\u0439 \u043c\u044b \u0437\u0430\u043f\u043e\u043d\u044f\u0435\u043c <b>_path.edit<\/b>, \u0441\u043d\u0438\u043c\u0430\u0435\u043c \u043b\u0438\u0448\u043d\u0435\u0435 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0435, \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0444\u043e\u043a\u0443\u0441 \u043d\u0430 \u043d\u0443\u0436\u043d\u044b\u0439 \u043d\u0430\u043c input (\u0437\u0434\u0435\u0441\u044c \u044f \u043d\u0435\u043c\u043d\u043e\u0436\u043a\u043e \u0441\u0445\u0438\u0442\u0440\u0438\u043b, \u0434\u0430\u0432 input-\u0443 <code>id = todo.id<\/code>).<\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u044f \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0436\u043c\u0435\u043c \u043b\u0438\u0431\u043e enter, \u043b\u0438\u0431\u043e esq. \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u043e\u0434\u0438\u043d \u0438\u0437 \u0434\u0432\u0443\u0445 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432: <code>doneEditing<\/code>, <code>cancelEditing<\/code>. \u0418\u0437\u0443\u0447\u0438\u0442\u0435 \u043a\u043e\u0434 \u2014 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u043e\u0432\u043e\u0433\u043e.<\/p>\n<h4>\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0445 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447 \u2014 \u0440\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438<\/h4>\n<p>  \u0418\u0442\u0430\u043a, \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u0447\u0442\u043e \u043c\u044b \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u2014 \u044d\u0442\u043e \u0432\u044b\u0432\u0435\u0434\u0435\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0445 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447 \u0432 \u0444\u0443\u0442\u0435\u0440\u0435. \u042d\u0442\u043e \u0445\u043e\u0440\u043e\u0448\u0438\u0439 \u043f\u043e\u0432\u043e\u0434 \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043e\u0431\u044a\u044f\u0441\u043d\u0438\u0442\u044c, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0440\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041d\u0435\u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0440\u0435\u043c\u0430\u0440\u043a\u0430 \u043d\u0430 \u0441\u0447\u0435\u0442 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/b><\/p>\n<div class=\"spoiler_text\">\u0421\u043b\u0435\u0434\u0443\u0435\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0442\u043e\u0442 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f \u0432\u044b\u0431\u0440\u0430\u043b \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c. \u041e\u0431\u0434\u0443\u043c\u044b\u0432\u0430\u044f \u0434\u0430\u043d\u043d\u044b\u0439, \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u0441 \u0445\u043e\u0434\u0443 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u043d\u0430 \u0443\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 live-query \u2014 \u044d\u0442\u043e \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u043e\u0444\u0438\u0433\u0435\u043d\u043d\u044b\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0434\u0435\u0440\u0431\u0438, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u0441\u0434\u0435\u043b\u0430\u0442\u044c mongo-\u0437\u0430\u043f\u0440\u043e\u0441 \u0432 \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445, \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0431\u0443\u0434\u0443\u0442 \u0440\u0435\u0430\u0442\u043a\u0438\u0432\u043d\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c\u0441\u044f. \u0412 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u0445, \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u043e\u0442\u0431\u043e\u0440\u044b, \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438, \u043e\u0440\u0433\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u043f\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0443 (<code>$limit<\/code>, <code>$skip<\/code>, <code>$orderby<\/code>). \u041c\u043e\u0436\u043d\u043e \u0442\u0430\u043a \u0436\u0435 \u0434\u0435\u043b\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u044b, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0449\u0438\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 (\u0441 \u043a\u0430\u043a\u0438\u043c\u0438-\u043d\u0438\u0431\u0443\u0434\u044c \u043e\u0442\u0431\u043e\u0440\u0430\u043c\u0438) \u2014 \u044d\u0442\u043e \u043a\u0430\u043a \u0440\u0430\u0437 \u043d\u0430\u0448 \u0441\u043b\u0443\u0447\u0430\u0439. \u00ab\u0416\u0438\u0432\u044b\u0435\u00bb \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043c\u044b \u0438\u0437\u0443\u0447\u0435\u043c \u0432 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u043f\u043e\u0441\u0442\u043e\u0432, \u0441\u0435\u0439\u0447\u0430\u0441 \u0436\u0435 \u044f \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u043b \u0443\u043c\u0435\u0441\u0442\u043d\u044b\u043c \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0447\u0435\u0440\u0435\u0437 \u0440\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0442\u043e\u0436\u0435 \u0447\u0430\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445.  <\/div>\n<\/div>\n<p>  \u0418\u0442\u0430\u043a, \u0440\u0435\u043a\u0442\u0438\u0432\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u2014 \u044d\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u043f\u0440\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u043a\u0430\u043a\u0438\u0445-\u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0445. \u0422\u043e \u0435\u0441\u0442\u044c \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0443\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u0432\u043e\u0442 \u044d\u0442\u0430 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u0430\u044f \u0440\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u0441\u043b\u0435\u0434\u0438\u0442\u044c \u0437\u0430 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435\u043c \u0432\u043e\u0442 \u044d\u0442\u0438\u0445 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445. \u042d\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0440\u0438\u0445\u043e\u0434\u044f\u0442 \u0432 \u044d\u0442\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432. \u0414\u0430\u043b\u0435\u0435 \u043e\u043d\u0430 \u0447\u0442\u043e-\u0442\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b. \u0415\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043f\u0440\u0438\u0432\u044f\u0437\u044b\u0432\u044e\u0442\u0441\u044f \u043a \u043a\u0430\u043a\u043e\u043c\u0443-\u0442\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u043c\u0443 \u00ab\u043f\u0443\u0442\u0438\u00bb\u2026<\/p>\n<p>  \u041b\u0430\u0434\u043d\u043e, \u044d\u0442\u043e \u0432\u0441\u0435 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u043e \u0438 \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0442\u044f\u0436\u0435\u043b\u043e \u0434\u043b\u044f \u0432\u043e\u0441\u043f\u0440\u0438\u044f\u0442\u0438\u044f. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043d\u0430 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435. \u0423 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044f todos \u0441 \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u043c\u0438 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u044b\u043c\u0438 \u0437\u0430\u0434\u0430\u0447\u0430\u043c\u0438. \u0425\u043e\u0440\u043e\u0448\u043e \u0431\u044b, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438 \u043b\u044e\u0431\u043e\u043c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438, \u043d\u0430\u043c, \u0433\u0434\u0435-\u043d\u0438\u0431\u0443\u0434\u044c (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u043e \u043f\u0443\u0442\u0438 <code>_page.counters<\/code>), \u0431\u044b\u043b\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0441\u0447\u0435\u0442\u0447\u0438\u043a\u0438 \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0445 \u0438 \u0432\u044b\u043f\u043e\u043b\u0435\u043d\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447. \u0427\u0442\u043e-\u0442\u043e \u0442\u0438\u043f\u0430:<\/p>\n<pre><code class=\"javascript\">_page.counters = {   active: 2,   completed: 3 } <\/code><\/pre>\n<p>  \u0422\u043e\u0433\u0434\u0430 \u0431\u044b \u043c\u044b \u0441\u043c\u043e\u0433\u043b\u0438 \u043b\u0435\u0433\u043a\u043e \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u044d\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0444\u0443\u0442\u0435\u0440.<\/p>\n<p>  \u041e\u0434\u0438\u043d \u0438\u0437 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0441\u0447\u0435\u0442\u0447\u0438\u043a\u0438 \u2014 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u043e\u043d\u0438 \u0442\u0430\u043a \u0436\u0435, \u043a\u0430\u043a \u0438 \u0444\u0438\u043b\u044c\u0442\u0440\u044b:<\/p>\n<pre><code class=\"javascript\">app.on('model', function(model) {   model.fn('all',       function(item) { return true; });   model.fn('completed', function(item) { return  item.completed;});   model.fn('active',    function(item) { return !item.completed;});    model.fn('counters', function(todos){     var counters = { active: 0, completed: 0 };     for (var id in todos) {       if(todos[id].completed) counters.completed++; else counters.active++;     }     return counters;   }) }); <\/code><\/pre>\n<p>  \u0412\u043e\u0442 \u043a\u0430\u043a \u043c\u044b \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>counters<\/code>, \u043d\u043e \u044d\u0442\u043e \u0435\u0449\u0435 \u043d\u0435 \u0432\u0441\u0435. \u0415\u0435 \u0435\u0449\u0435 \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0432 \u043d\u0443\u0436\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0438 \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u0442\u044c \u043a \u043f\u0443\u0442\u044f\u043c. \u042d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u0432 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0435, \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>model.start<\/code>:  <\/p>\n<pre><code class=\"javascript\">    model.subscribe('todos', function () {       model.filter('todos', filter).ref('_page.todos');       model.start('_page.counters', 'todos', 'counters');       page.render();     }); <\/code><\/pre>\n<p>  \u0412\u0441\u0435, \u0442\u0435\u043f\u0435\u0440\u044c \u0441\u0447\u0435\u0442\u0447\u0438\u043a\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0432 \u043d\u0430\u0448\u0438\u0445 \u0448\u0430\u0431\u043b\u043e\u043d\u0430\u0445. \u0414\u043e\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c \u0444\u0443\u0442\u0435\u0440:<\/p>\n<pre><code class=\"html\">&lt;footer:&gt;   &lt;footer id=&quot;footer&quot;&gt;       &lt;span id=&quot;todo-count&quot;&gt;&lt;strong&gt;{{_page.counters.active}} &lt;\/strong&gt;         &lt;span&gt;items left&lt;\/span&gt;       &lt;\/span&gt;     &lt;ul id=&quot;filters&quot;&gt;       &lt;li&gt;&lt;a href=&quot;\/&quot;           class=&quot;{{if $render.url==='\/'         }}selected{{\/}}&quot;&gt;All&lt;\/a&gt;&lt;\/li&gt;       &lt;li&gt;&lt;a href=&quot;\/active&quot;     class=&quot;{{if $render.url==='\/active'   }}selected{{\/}}&quot;&gt;Active&lt;\/a&gt;&lt;\/li&gt;       &lt;li&gt;&lt;a href=&quot;\/completed&quot;  class=&quot;{{if $render.url==='\/completed'}}selected{{\/}}&quot;&gt;Completed&lt;\/a&gt;&lt;\/li&gt;     &lt;\/ul&gt;     &lt;button id=&quot;clear-completed&quot; on-click=&quot;clearCompleted()&quot; class=&quot;{{if _page.counters.completed==0}}hidden{{\/}}&quot;&gt;       Clear completed ({{_page.counters.completed}})     &lt;\/button&gt;   &lt;\/footer&gt; <\/code><\/pre>\n<p>  \u041f\u043e\u043a\u0430\u0437\u0430\u043b\u0438 \u043d\u0443\u0436\u043d\u044b\u0435 \u0441\u0447\u0435\u0442\u0447\u0438\u043a\u0438, \u043f\u043e\u043f\u0443\u0442\u043d\u043e \u0441\u043a\u0440\u044b\u0432 \u043a\u043d\u043e\u043f\u043a\u0443 \u00abClear completed\u00bb, \u0435\u0441\u043b\u0438 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447 \u043d\u0435\u0442. \u0422\u0430\u043a \u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u043a\u043b\u0430\u0441\u0441 <code>selected<\/code> \u0442\u043e\u0439 \u0441\u0441\u044b\u043b\u043a\u0435, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0430\u043a\u0442\u0438\u0432\u043d\u0430, \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0432\u0448\u0438\u0441\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0439 \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u044f <code>app.model.get()<\/code> \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430. \u0414\u0430, \u0437\u0430\u0440\u0435\u0437\u0435\u0440\u0432\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044f <code>$render<\/code> \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u0443\u044e \u043f\u043e\u043b\u0435\u0437\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e, \u0432 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438 <code>url<\/code>, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u0448\u0435\u043b \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433. \u0417\u0430\u0433\u043b\u044f\u043d\u0438\u0442\u0435 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u0435\u0449\u0435 \u0440\u0430\u0437.<\/p>\n<h4>\u0418\u0442\u043e\u0433<\/h4>\n<p>  \u0414\u0430\u0432\u0439\u0442\u0435 \u043f\u043e\u0438\u0433\u0440\u0430\u0438\u043c\u0441\u044f \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c, \u043e\u0442\u043a\u0440\u043e\u0435\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u043a\u043b\u0430\u0434\u043e\u043a, \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c, \u0447\u0442\u043e \u0432\u0441\u0435 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f:<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/264\/cf4\/51c\/264cf451cb603141fb5cca238fe436c3.png\"\/><\/p>\n<p>  \u041f\u0440\u043e\u0435\u043a\u0442 \u043d\u0430 <a href=\"https:\/\/github.com\/zag2art\/derby-example-todo.git\">github<\/a>, \u043d\u0430 \u0441\u043b\u0443\u0447\u0430\u0439, \u0435\u0441\u043b\u0438 \u0437\u0430\u0445\u043e\u0442\u0438\u0442\u0435 \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c \u043a\u043e\u0434.<\/p>\n<p>  <b>P. S.<\/b><br \/>  \u0415\u0441\u043b\u0438 \u043d\u0435 \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0441\u0442\u0430\u0442\u044c\u0438 \u043f\u043e derbyjs, \u043f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0439\u0442\u0435\u0441\u044c \u043d\u0430 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0432 \u043c\u043e\u0435\u043c \u043f\u0440\u043e\u0444\u0438\u043b\u0435: <a href=\"http:\/\/habrahabr.ru\/users\/zag2art\/\">zag2art<\/a>. \u0421\u0430\u043c \u0442\u0430\u043a \u0434\u0435\u043b\u0430\u044e.  \t\t\t\t<\/p>\n<div class=\"polling\">\n<form action=\"\/json\/polling\/\" class=\"poll\" method=\"post\">\n<div class=\"poll_title\">\u0421\u0442\u043e\u0438\u0442 \u043b\u0438 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0442\u044c?<\/div>\n<p>  \t\t<input type=\"hidden\" name=\"post_id\" value=\"221703\"\/> \t\t<input type=\"hidden\" name=\"polling_question_id\" value=\"10989\"\/>  \t\t<\/p>\n<table class=\"answer\">\n<tr>\n<td class=\"input\"> \t\t\t\t\t<input type=\"radio\" id=\"vv55681\" \t\t\t\t\t\tclass=\"radio js-field-data\" \t\t\t\t\t\tname=\"variant[]\" \t\t\t\t\t\tvalue=\"55681\" \/> \t\t\t\t<\/td>\n<td class=\"label\"> \t\t\t\t\t<label for=\"vv55681\">\u0414\u0430<\/label> \t\t\t\t<\/td>\n<\/tr>\n<tr>\n<td class=\"input\"> \t\t\t\t\t<input type=\"radio\" id=\"vv55683\" \t\t\t\t\t\tclass=\"radio js-field-data\" \t\t\t\t\t\tname=\"variant[]\" \t\t\t\t\t\tvalue=\"55683\" \/> \t\t\t\t<\/td>\n<td class=\"label\"> \t\t\t\t\t<label for=\"vv55683\">\u041d\u0435\u0442<\/label> \t\t\t\t<\/td>\n<\/tr>\n<\/table>\n<p class=\"for_users_only_msg\">\u0422\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u043c\u043e\u0433\u0443\u0442 \u0443\u0447\u0430\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0432 \u043e\u043f\u0440\u043e\u0441\u0435. <a href=\"https:\/\/habrahabr.ru\/auth\/login\/\">\u0412\u043e\u0439\u0434\u0438\u0442\u0435<\/a>, \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430.<\/p>\n<p class=\"total\">\u041d\u0438\u043a\u0442\u043e \u0435\u0449\u0451 \u043d\u0435 \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u0430\u043b. \u0412\u043e\u0437\u0434\u0435\u0440\u0436\u0430\u0432\u0448\u0438\u0445\u0441\u044f \u043d\u0435\u0442.<\/p>\n<\/p><\/form>\n<form action=\"\/json\/polling\/\" class=\"poll\" method=\"post\">\n<div class=\"poll_title\">\u0427\u0442\u043e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0440\u0430\u0437?<\/div>\n<p>  \t\t<input type=\"hidden\" name=\"post_id\" value=\"221703\"\/> \t\t<input type=\"hidden\" name=\"polling_question_id\" value=\"10991\"\/>  \t\t<\/p>\n<table class=\"answer\">\n<tr>\n<td class=\"input\"> \t\t\t\t\t<input type=\"radio\" id=\"vv55685\" \t\t\t\t\t\tclass=\"radio js-field-data\" \t\t\t\t\t\tname=\"variant[]\" \t\t\t\t\t\tvalue=\"55685\" \/> \t\t\t\t<\/td>\n<td class=\"label\"> \t\t\t\t\t<label for=\"vv55685\">\u0410\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044e<\/label> \t\t\t\t<\/td>\n<\/tr>\n<tr>\n<td class=\"input\"> \t\t\t\t\t<input type=\"radio\" id=\"vv55687\" \t\t\t\t\t\tclass=\"radio js-field-data\" \t\t\t\t\t\tname=\"variant[]\" \t\t\t\t\t\tvalue=\"55687\" \/> \t\t\t\t<\/td>\n<td class=\"label\"> \t\t\t\t\t<label for=\"vv55687\">\u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b<\/label> \t\t\t\t<\/td>\n<\/tr>\n<tr>\n<td class=\"input\"> \t\t\t\t\t<input type=\"radio\" id=\"vv55689\" \t\t\t\t\t\tclass=\"radio js-field-data\" \t\t\t\t\t\tname=\"variant[]\" \t\t\t\t\t\tvalue=\"55689\" \/> \t\t\t\t<\/td>\n<td class=\"label\"> \t\t\t\t\t<label for=\"vv55689\">\u0412\u0430\u0448 \u0432\u0430\u0440\u0438\u0430\u043d\u0442<\/label> \t\t\t\t<\/td>\n<\/tr>\n<\/table>\n<p class=\"for_users_only_msg\">\u0422\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u043c\u043e\u0433\u0443\u0442 \u0443\u0447\u0430\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0432 \u043e\u043f\u0440\u043e\u0441\u0435. <a href=\"https:\/\/habrahabr.ru\/auth\/login\/\">\u0412\u043e\u0439\u0434\u0438\u0442\u0435<\/a>, \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430.<\/p>\n<p class=\"total\">\u041d\u0438\u043a\u0442\u043e \u0435\u0449\u0451 \u043d\u0435 \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u0430\u043b. \u0412\u043e\u0437\u0434\u0435\u0440\u0436\u0430\u0432\u0448\u0438\u0445\u0441\u044f \u043d\u0435\u0442.<\/p>\n<\/p><\/form>\n<\/p><\/div>\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\/post\/221703\/\"> http:\/\/habrahabr.ru\/post\/221703\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t<img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/fd8\/eb0\/5a8\/fd8eb05a89c50e810f0daf8f6b54731a.png\" alt=\"todos\"\/><\/p>\n<p>  \u042d\u0442\u043e\u0442 \u043f\u043e\u0441\u0442 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u0435 \u0441\u0435\u0440\u0438\u0438, \u043d\u0430\u0447\u0430\u0442\u043e\u0439 <a href=\"http:\/\/habrahabr.ru\/post\/221027\/\">\u0437\u0434\u0435\u0441\u044c<\/a>. \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c, \u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0439, \u00ab\u0441\u043f\u0438\u0441\u043e\u043a \u0434\u0435\u043b\u00bb (Todo-<br \/>  list \u0438\u0437 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 <a href=\"http:\/\/todomvc.com\/\">TodoMVC<\/a>). \u0417\u0430 \u043e\u0441\u043d\u043e\u0432\u0443 \u0432\u043e\u0437\u044c\u043c\u0435\u043c \u0432\u0430\u0440\u0438\u043d\u0442, <a href=\"http:\/\/todomvc.com\/architecture-examples\/angularjs\/#\/\">\u0441\u0434\u0435\u043b\u0430\u043d\u043d\u044b\u0439 \u043d\u0430 Angular<\/a>, \u0438 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0432\u043e\u0441\u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u043d\u0430 <a href=\"http:\/\/derbyjs.com\/\">derby<\/a>.  <\/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-221703","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/221703","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=221703"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/221703\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=221703"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=221703"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=221703"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}