{"id":203890,"date":"2013-11-29T10:08:03","date_gmt":"2013-11-29T06:08:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=203890"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=203890","title":{"rendered":"<span class=\"post_title\">JohnSmith \u2014 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0438 \u043b\u0435\u0433\u043a\u043e\u0432\u0435\u0441\u043d\u044b\u0439 JavaScript-\u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u0434\u043b\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f UI<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t<img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/f85\/44f\/bbf\/f8544fbbf739316fa9c3b7984dbbd53b.png\" align=\"left\"\/><\/p>\n<p>  \u041d\u0430 \u0441\u0435\u0433\u043e\u0434\u043d\u044f\u0448\u043d\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043c\u0430\u0441\u0441\u0430 JavaScript-\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f rich-client \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439. \u041a\u0440\u043e\u043c\u0435 \u0432\u0441\u0435\u043c \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0445 Knockout, Angular.JS \u0438 Ember \u0435\u0441\u0442\u044c \u0432\u0435\u043b\u0438\u043a\u043e\u0435 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0434\u0440\u0443\u0433\u0438\u0445 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u0432, \u0438 \u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u043c\u0435\u0435\u0442 \u0441\u0432\u043e\u044e \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u2014 \u043a\u0442\u043e-\u0442\u043e \u043f\u0440\u043e\u043f\u0430\u0433\u0430\u043d\u0434\u0438\u0440\u0443\u0435\u0442 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u0438\u0437\u043c, \u0430 \u043a\u0442\u043e-\u0442\u043e \u2014 \u0438\u0434\u0435\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0447\u0438\u0441\u0442\u043e\u0442\u0443 \u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u0444\u0438\u043b\u043e\u0441\u043e\u0444\u0438\u0438 MVC. \u041f\u0440\u0438 \u0432\u0441\u0451\u043c \u044d\u0442\u043e\u043c \u043c\u043d\u043e\u0433\u043e\u043e\u0431\u0440\u0430\u0437\u0438\u0438, \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e \u043f\u043e\u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0432\u0441\u0451 \u043d\u043e\u0432\u044b\u0435 \u0438 \u043d\u043e\u0432\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438. \u0418\u0437 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e, \u0447\u0442\u043e \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043b\u043e\u0441\u044c \u043d\u0430 \u0445\u0430\u0431\u0440\u0435 \u2014 <a href=\"http:\/\/habrahabr.ru\/post\/198158\/\">Warp9<\/a> \u0438 <a href=\"http:\/\/habrahabr.ru\/post\/196146\/\">Matreshka.js<\/a>. \u0412 \u0441\u0432\u044f\u0437\u0438 \u0441 \u044d\u0442\u0438\u043c \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043e \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u043f\u043e\u0434\u0435\u043b\u043a\u0435, \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0439\u0442\u0435, JohnSmith \u2014 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0438 \u043b\u0435\u0433\u043a\u043e\u0432\u0435\u0441\u043d\u044b\u0439 JavaScript \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u0434\u043b\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f UI.<\/p>\n<p>  <br clear=\"left\"\/>  <a name=\"habracut\"><\/a><\/p>\n<p>  \u041f\u0440\u0435\u0436\u0434\u0435 \u0432\u0441\u0435\u0433\u043e, \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e JohnSmith \u043f\u0438\u0441\u0430\u043b\u0441\u044f \u043d\u0435 \u0440\u0430\u0434\u0438 \u043a\u0430\u043a\u043e\u0433\u043e-\u0442\u043e \u0430\u043a\u0430\u0434\u0435\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0430 \u0438 \u043d\u0435 \u0434\u043b\u044f \u0443\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0442\u043e\u0433\u043e \u0441\u0430\u043c\u043e\u0433\u043e \u0444\u0430\u0442\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0430. \u0421\u043e\u0432\u0441\u0435\u043c \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442, JohnSmith \u0437\u0430\u0440\u043e\u0434\u0438\u043b\u0441\u044f \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435, \u0437\u0430\u0442\u0435\u043c \u043c\u0438\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u043b \u0438\u0437 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442, \u043f\u043e\u0441\u0442\u0435\u043f\u0435\u043d\u043d\u043e \u0443\u043b\u0443\u0447\u0448\u0430\u044f\u0441\u044c \u0438 \u043c\u0435\u043d\u044f\u044f \u0441\u0432\u043e\u044e \u0444\u043e\u0440\u043c\u0443. \u0418 \u0432\u043e\u0442 \u0442\u0435\u043f\u0435\u0440\u044c \u043e\u043d \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b\u0441\u044f \u043a\u0430\u043a \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u0430\u044f open-source \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430.<\/p>\n<p>  <\/p>\n<h2>\u041f\u0440\u0438\u043c\u0435\u0440<\/h2>\n<p>  \u0414\u043b\u044f \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 JohnSmith, \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0435\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e: <\/p>\n<p>  <strong>\u0418\u043c\u0435\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u0435 \u0432\u0432\u043e\u0434\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043f\u0438\u0448\u0435\u0442 \u0441\u0432\u043e\u0451 \u0438\u043c\u044f. \u041a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u043c\u044f \u0432\u0432\u0435\u0434\u0435\u043d\u043e, \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435: <em>Hello, %username%<\/em>.<\/strong><\/p>\n<p>  \u041a\u043e\u043c\u0443 \u0441\u0440\u0430\u0437\u0443 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442: \u0432\u043e\u0442 \u0433\u043e\u0442\u043e\u0432\u044b\u0439 <a href=\"http:\/\/john-smith-js.com\/index.html\">User Greeter<\/a>.<\/p>\n<h2>View Model<\/h2>\n<p>  \u041d\u0430\u0447\u043d\u0451\u043c \u0441 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f View Model, \u0438 \u043f\u0440\u0435\u0436\u0434\u0435 \u0432\u0441\u0435\u0433\u043e, \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u00ab\u043a\u043b\u0430\u0441\u0441\u00bb:<\/p>\n<pre><code class=\"javascript\">var GreeterViewModel = function(){ } <\/code><\/pre>\n<p>  View Model \u043e\u0431\u044b\u0447\u043d\u043e \u00ab\u0432\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u00bb \u0432\u043e \u0432\u043d\u0435\u0448\u043d\u0438\u0439 \u043c\u0438\u0440 \u043e\u0431\u044a\u0435\u043a\u0442\u044b, \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u043e\u0433\u0443\u0442 \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0438\u0437 \u0432\u043d\u0435. \u0412 JohnSmith \u044d\u0442\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f bindable. \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u043f\u043e\u043b\u0435 \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0438\u043c\u0435\u043d\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f:<\/p>\n<pre><code class=\"javascript\">var GreeterViewModel = function(){     this.userName = js.bindableValue(); }; <\/code><\/pre>\n<p>  \u042d\u0442\u043e \u043f\u043e\u043b\u0435 (<code>userName<\/code>) \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u0434\u0432\u0443\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u043d\u0438\u044f \u0432 \u0412\u0438\u0434\u0435. \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0435\u0449\u0435 \u043e\u0434\u043d\u043e \u043f\u043e\u043b\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0431\u0443\u0434\u0435\u0442 \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u0435\u043a\u0441\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f. \u042d\u0442\u043e \u043f\u043e\u043b\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 <code>userName<\/code>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u043f\u0438\u0448\u0435\u043c \u0435\u0433\u043e \u0432 \u0432\u0438\u0434\u0435 <code>dependentValue<\/code>:<\/p>\n<pre><code class=\"javascript\">    var GreeterViewModel = function(){     this.userName = js.bindableValue();      this.greetMessage = js.dependentValue(         this.userName,         function(userNameValue){             if (userNameValue) {                 return &quot;Hello, &quot; + userNameValue + &quot;!&quot;;             }              return &quot;Please, enter your name&quot;;         }); }; <\/code><\/pre>\n<p>  js.dependentValue \u043f\u043e\u0445\u043e\u0436 \u043d\u0430 computed \u0432 knockout, \u0437\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0432 JohnSmith \u043c\u044b \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438, \u0442.\u043a. \u0437\u0430 \u0441\u0446\u0435\u043d\u043e\u0439 \u043d\u0435\u0442 \u043d\u0438\u043a\u0430\u043a\u043e\u0439 \u043c\u0430\u0433\u0438\u0438 \u0430\u0432\u0442\u043e-\u0442\u0440\u0435\u043a\u0438\u043d\u0433\u0430.<\/p>\n<p>  \u041c\u043e\u0434\u0435\u043b\u044c \u0412\u0438\u0434\u0430 \u0433\u043e\u0442\u043e\u0432\u0430, \u0442\u0435\u043f\u0435\u0440\u044c \u043e\u043f\u0438\u0448\u0435\u043c \u0412\u0438\u0434.<\/p>\n<h2>View<\/h2>\n<p>  \u041d\u0430\u0447\u043d\u0451\u043c \u0441 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043a\u043b\u0430\u0441\u0441\u0430:<\/p>\n<pre><code class=\"javascript\">var GreeterView = function(){ } <\/code><\/pre>\n<p>  \u0412\u0438\u0434 \u2014 \u044d\u0442\u043e \u0441\u043e\u0432\u043e\u043a\u0443\u043f\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0438 \u0438 \u043b\u043e\u0433\u0438\u043a\u0438 \u0441\u0432\u044f\u0437\u0438 \u044d\u0442\u043e\u0439 \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0438 \u0441 \u0432\u043d\u0435\u0448\u043d\u0438\u043c \u043c\u0438\u0440\u043e\u043c. \u0420\u0430\u0437\u043c\u0435\u0442\u043a\u0430 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u043f\u043e\u043b\u0435 <code>template<\/code>, \u0430 \u043b\u043e\u0433\u0438\u043a\u0430 \u2014 \u0432 \u043c\u0435\u0442\u043e\u0434\u0435 <code>init<\/code>:<\/p>\n<pre><code class=\"javascript\">var GreeterView = function(){     this.template = &quot;...\u0437\u0434\u0435\u0441\u044c \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0443...&quot;;     this.init = function(){       \/\/ \u0437\u0434\u0435\u0441\u044c \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u043b\u043e\u0433\u0438\u043a\u0443     } }; <\/code><\/pre>\n<p>  \u0412 \u043d\u0430\u0448\u0435\u043c \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0430 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e-\u0442\u0430\u043a\u0438 \u043f\u0440\u043e\u0441\u0442\u0430\u044f, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0437\u0430\u043f\u0438\u0448\u0435\u043c \u0435\u0451 \u043f\u0440\u044f\u043c\u043e \u0432 \u043f\u043e\u043b\u0435 template:<\/p>\n<pre><code class=\"javascript\">var GreeterView = function(){     this.template =         &quot;&lt;p&gt;Enter your name: &lt;input type='text'\/&gt;&lt;\/p&gt;&quot; +         &quot;&lt;p class='message'&gt;&lt;\/p&gt;&quot;;      this.init = function(){         \/\/ \u0437\u0434\u0435\u0441\u044c \u0441\u043a\u043e\u0440\u043e \u0431\u0443\u0434\u0435\u0442 \u043b\u043e\u0433\u0438\u043a\u0430     }; }; <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u043c\u0435\u0442\u043e\u0434\u0443 <code>init<\/code>. \u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, JohnSmith \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u0435\u0442, \u0447\u0442\u043e \u043a\u0430\u0436\u0434\u044b\u0439 \u0412\u0438\u0434 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0439 \u041c\u043e\u0434\u0435\u043b\u044c\u044e \u0412\u0438\u0434\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 viewModel:<\/p>\n<pre><code class=\"javascript\">var GreeterView = function(){     this.template =         &quot;&lt;p&gt;Enter your name: &lt;input type='text'\/&gt;&lt;\/p&gt;&quot; +         &quot;&lt;p class='message'&gt;&lt;\/p&gt;&quot;;      this.init = function(viewModel){                        \/\/ &lt;---         \/\/ \u0437\u0434\u0435\u0441\u044c \u0441\u043a\u043e\u0440\u043e \u0431\u0443\u0434\u0435\u0442 \u043b\u043e\u0433\u0438\u043a\u0430     }; }; <\/code><\/pre>\n<p>  \u0414\u0430\u043b\u044c\u0448\u0435 \u043d\u0430\u0448\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u0441\u0432\u044f\u0437\u0430\u0442\u044c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u041c\u043e\u0434\u0435\u043b\u0438 \u0412\u0438\u0434\u0430 \u0441 \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u043e\u0439, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u00ab\u043e\u0442\u0440\u0438\u0441\u0443\u0435\u0442\u00bb \u043d\u0430\u0448 \u0412\u0438\u0434. JohnSmith \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0434\u043b\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u044d\u0442\u043e\u0439 \u0441\u0432\u044f\u0437\u0438 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432 js-\u043a\u043e\u0434\u0435. \u0414\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u0441\u043b\u0443\u0447\u0430\u044f \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<pre><code class=\"javascript\">var GreeterView = function(){     this.template =         &quot;&lt;p&gt;Enter your name: &lt;input type='text'\/&gt;&lt;\/p&gt;&quot; +         &quot;&lt;p class='message'&gt;&lt;\/p&gt;&quot;;      this.init = function(viewModel){         this.bind(viewModel.userName).to(&quot;input&quot;);          \/\/ &lt;---         this.bind(viewModel.greetMessage).to(&quot;.message&quot;);   \/\/ &lt;---     }; }; <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0432\u0441\u0451 \u0433\u043e\u0442\u043e\u0432\u043e \u0438 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0448 \u0432\u0438\u0434 (\u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u0435\u0441\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0441 id=&#8217;greeter&#8217;):<\/p>\n<pre><code class=\"javascript\">js.renderView(GreeterView, new GreeterViewModel()).to(&quot;#greeter&quot;); <\/code><\/pre>\n<p>  \u0418\u0442\u0430\u043a, \u043d\u0430 \u044d\u0442\u043e\u043c \u043d\u0430\u0448\u0435 \u043c\u0438\u043d\u0438-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0437\u0430\u043a\u043e\u043d\u0447\u0435\u043d\u043e, \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c <a href=\"http:\/\/john-smith-js.com\/index.html\">\u0442\u0443\u0442<\/a>. \u042d\u0442\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442 \u043e\u0441\u043d\u043e\u0432\u043d\u0443\u044e \u0444\u0438\u043b\u043e\u0441\u043e\u0444\u0438\u044e \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430, \u043d\u043e \u0447\u0442\u043e\u0431\u044b \u0431\u043e\u043b\u044c\u0448\u0435 \u0443\u0437\u043d\u0430\u0442\u044c \u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u0445 JohnSmith, \u043f\u0440\u043e\u044f\u0441\u043d\u0438\u043c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u0435\u0442\u0430\u043b\u0438.<\/p>\n<h2>Binding<\/h2>\n<p>  \u041e\u0441\u043d\u043e\u0432\u0430 \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u043d\u0438\u044f \u0432 JohnSmith \u2014 \u044d\u0442\u043e observable-\u043e\u0431\u044a\u0435\u043a\u0442\u044b (\u043a\u0430\u043a \u0432 knockout). \u0421\u043e\u0437\u0434\u0430\u044e\u0442\u0441\u044f \u044d\u0442\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u043c\u0435\u0442\u043e\u0434\u043e\u0432:<\/p>\n<ul>\n<li><code>js.bindableValue<\/code> \u2014 \u043e\u0431\u044b\u0447\u043d\u044b\u0439 observable \u043e\u0431\u044a\u0435\u043a\u0442;<\/li>\n<li><code>js.dependentValue<\/code> \u2014 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0437\u0430\u0432\u0438\u0441\u044f\u0449\u0435\u0435 \u043e\u0442 \u0434\u0440\u0443\u0433\u0438\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432;<\/li>\n<li><code>js.bindableList<\/code> \u2014 observable-\u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044f, \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u044f\u0435\u0442 \u043f\u043e\u0434\u043f\u0438\u0441\u0447\u0438\u043a\u043e\u0432 \u043e \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0438\/\u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432.<\/li>\n<\/ul>\n<p>  \u041d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u043d\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 A \u0438 \u0441\u043b\u0443\u0448\u0430\u0442\u0435\u043b\u044f B \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u0434\u043e\u043c \u0432\u0438\u0434\u0430:<\/p>\n<pre><code class=\"javascript\">js.bind(A).to(B); <\/code><\/pre>\n<p>  \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"javascript\">var firstName = js.bindableValue();   \/\/ \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u043e\u0431\u044a\u0435\u043a\u0442 js.bind(firstName).to(&quot;.firstName&quot;);  \/\/ \u043f\u0440\u0438\u0432\u044f\u0437\u044b\u0432\u0430\u0435\u043c \u043a jQuery-\u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440\u0443 firstName.setValue(&quot;John&quot;);           \/\/ \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 <\/code><\/pre>\n<p>  \u0412\u043d\u0443\u0442\u0440\u0438 \u0412\u0438\u0434\u0430 \u043a\u043e\u0434 \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0438 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f:<\/p>\n<pre><code class=\"javascript\">\/\/ \u043c\u044b \u0432\u043d\u0443\u0442\u0440\u0438 \u043c\u0435\u0442\u043e\u0434\u0430 init \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0412\u0438\u0434\u0430 this.bind(viewModel.firstName).to(&quot;.firstName&quot;); <\/code><\/pre>\n<p>  \u0418 \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u043e\u0438\u0441\u043a \u043f\u043e \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440\u0443 <code>.firstName<\/code> \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u043d\u0443\u0442\u0440\u0438 \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0438 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0412\u0438\u0434\u0430, \u0430 \u043d\u0435 \u0432\u043e \u0432\u0441\u0451\u043c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0435. \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u044d\u0442\u043e\u043c\u0443 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u043d\u0430\u044f \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u0432\u0438\u0434\u0430 \u043e\u0442 \u0432\u043d\u0435\u0448\u043d\u0435\u0433\u043e \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f.<\/p>\n<p>  \u0421\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 <code>js.bind(A).to(B)<\/code> \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043e\u0447\u0435\u0442\u0430\u0442\u044c \u00ab\u0434\u0435\u043a\u043b\u0430\u0440\u0430\u0442\u0438\u0432\u043d\u044b\u0439\u00bb \u0441\u0442\u0438\u043b\u044c \u0441 \u0438\u043c\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u044b\u043c \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c jQuery-style \u0432 \u0442\u0435\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445, \u0433\u0434\u0435 \u044d\u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e:<\/p>\n<pre><code class=\"javascript\">\/\/ \u044d\u0442\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u043e\u0445\u043e\u0436\u0435 \u043d\u0430 \u0434\u0435\u043a\u043b\u0430\u0440\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u0441\u0442\u0438\u043b\u044c: js.bind(firstName).to(&quot;.firstName&quot;);    js.bind(firstName).to(     function(newValue, oldValue){  \/\/ &lt;-- \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f         \/\/ \u0437\u0434\u0435\u0441\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c jQuery \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u043e,         \/\/ \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u043a\u0440\u044b\u0442\u044c\/\u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u043a\u0430\u043a\u0443\u044e-\u0442\u043e \u043f\u0430\u043d\u0435\u043b\u044c \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438         \/\/ \u043e\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 newValue\/oldValue, \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043a\u043b\u0430\u0441\u0441, \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044e \u0438 \u0442.\u043f.     }); <\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 bindable-\u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u043e\u0431\u044b\u0447\u043d\u043e\u0435 (\u043d\u0435 observable) \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0442\u043e \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0451\u0442 \u0435\u0434\u0438\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u044f \u0441 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u043c. \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0435\u0434\u0438\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043a\u0430\u043a observable \u0442\u0430\u043a \u0438 \u00ab\u043e\u0431\u044b\u0447\u043d\u044b\u0435\u00bb \u043f\u043e\u043b\u044f View Model:<\/p>\n<pre><code class=\"javascript\">var ViewModel = function(){     this.firstName = &quot;John&quot;;             \/\/ static value     this.lastName = js.bindableValue();  \/\/ observable value };  \/\/... \/\/ somewhere in the View: this.bind(viewModel.firstName).to(&quot;.firstName&quot;);  \/\/ will sync only once this.bind(viewModel.lastName).to(&quot;.lastName&quot;);    \/\/ will sync on every change <\/code><\/pre>\n<p>  \u0414\u043b\u044f \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0438 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0439 \u0412\u0438\u0434:<\/p>\n<pre><code class=\"javascript\">var ViewModel = function(){     this.myAddress = js.bindableValue();      this.initState = function(){         this.myAddress.setValue({             country: 'Russia',             city: js.bindableValue();         });     }; };  \/\/ ... this.bind(viewModel.myAddress).to(&quot;.address&quot;, AddressView); \/\/ ... <\/code><\/pre>\n<h2>Views Composition<\/h2>\n<p>  \u0412\u0438\u0434 \u0432 JohnSmith \u2014 \u044d\u0442\u043e \u0430\u0442\u043e\u043c\u0430\u0440\u043d\u0430\u044f \u0435\u0434\u0438\u043d\u0438\u0446\u0430 \u0434\u043b\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430. \u041a\u0430\u0436\u0434\u044b\u0439 \u0412\u0438\u0434 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u043c \u0438 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f. \u0418\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0432\u0441\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u0437 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u0412\u0438\u0434\u043e\u0432, \u043f\u0443\u0442\u0451\u043c \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u00ab\u0434\u0435\u0440\u0435\u0432\u0430\u00bb (<a href=\"http:\/\/en.wikipedia.org\/wiki\/Composite_pattern\">composite pattern<\/a>). \u0422\u043e \u0435\u0441\u0442\u044c, \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u043e\u0434\u0438\u043d \u0433\u043b\u0430\u0432\u043d\u044b\u0439 \u0412\u0438\u0434, \u0443 \u043d\u0435\u0433\u043e \u0435\u0441\u0442\u044c \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0435 \u0412\u0438\u0434\u044b, \u0443 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437 \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0445 \u0435\u0441\u0442\u044c \u0441\u0432\u043e\u0438 \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0435 \u0412\u0438\u0434\u044b \u0438 \u0442.\u0434. \u041a\u043e\u043c\u043f\u043e\u0437\u0438\u0446\u0438\u044f \u0434\u043e\u0441\u0442\u0438\u0433\u0430\u0435\u0442\u0441\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438:<\/p>\n<ul>\n<li>\u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u043e\u0447\u0435\u0440\u043d\u0435\u0433\u043e \u0432\u0438\u0434\u0430:\n<pre><code class=\"javascript\">var ParentView = function(){     this.init = function(){         this.addChild(&quot;.destination&quot;, new ChildView(), new ChildViewModel()); \/\/ &lt;--     } }; <\/code><\/pre>\n<\/li>\n<li>\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0412\u0438\u0434\u0430 \u0434\u043b\u044f \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0438 bindable-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f:\n<pre><code class=\"javascript\">var ParentView = function(){     this.init = function(viewModel){         this.bind(viewModel.details).to(&quot;.details&quot;, DetailsView);   \/\/ &lt;--     } };<\/code><\/pre>\n<\/li>\n<\/ul>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>  \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0437\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f, \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0438\u043c \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 JohnSmith:<\/p>\n<ul>\n<li>\u043a\u043e\u043c\u043f\u0430\u043d\u0443\u0435\u043c\u043e\u0441\u0442\u044c UI \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441 \u043b\u0435\u0433\u043a\u043e\u0441\u0442\u044c\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c JohnSmith \u0434\u043b\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u043b\u044e\u0431\u043e\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0441 \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u0430\u043d\u0438\u0435\u043c \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043b\u0435\u0433\u043a\u043e \u0443\u0434\u0430\u0451\u0442\u0441\u044f \u0434\u0435\u0440\u0436\u0430\u0442\u044c \u043a\u043e\u0434 \u043f\u043e\u0434 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0435\u043c. \u042d\u0442\u043e \u0434\u043e\u0441\u0442\u0438\u0433\u0430\u0435\u0442\u0441\u044f \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e \u0438 \u0447\u0435\u0442\u043a\u0438\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u043c\u0435\u0436\u0434\u0443 \u0412\u0438\u0434\u043e\u043c \u0438 \u041c\u043e\u0434\u0435\u043b\u044c\u044e;<\/li>\n<li>JohnSmith \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u2014 \u0432\u0441\u0435\u0433\u043e \u0434\u0432\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u0438 (View \u0438 Bindable), \u0434\u0430 \u0438 \u0442\u0435 \u0445\u043e\u0440\u043e\u0448\u043e \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b \u043b\u044e\u0431\u043e\u043c\u0443 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0443, \u0440\u0430\u0431\u043e\u0442\u0430\u0432\u0448\u0435\u043c\u0443 \u0441 UI. \u041d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u0441\u0434\u0432\u0438\u0433\u0430 \u043f\u0430\u0440\u0430\u0434\u0438\u0433\u043c\u044b \u0438 \u043d\u0438\u043a\u0430\u043a\u043e\u0439 \u043c\u0430\u0433\u0438\u0438 \u0437\u0430 \u0441\u0446\u0435\u043d\u043e\u0439;<\/li>\n<li>JohnSmith \u043e\u043f\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u043e\u0431\u044b\u0447\u043d\u044b\u043c\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438 \u0441 \u043e\u0431\u044b\u0447\u043d\u044b\u043c\u0438 \u043f\u043e\u043b\u044f\u043c\u0438 \u0438 \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438. \u042d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u0412\u0430\u043c \u043d\u0435 \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0442\u044c \u043a\u0430\u043a\u0438\u0435-\u043b\u0438\u0431\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043f\u043e\u043b\u0430\u0433\u0430\u044f\u0441\u044c \u043d\u0430 \u0441\u0442\u0440\u043e\u0447\u043d\u044b\u0435 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u044b (\u0442\u0438\u043f\u0430 <code>model.set('firstName', 'John')<\/code>). \u0422\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0442\u0435\u0441\u043d\u0443\u044e \u0434\u0440\u0443\u0436\u0431\u0443 \u0441 IDE \u0438 \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u0441\u043e\u0447\u0435\u0442\u0430\u0435\u0442\u0441\u044f \u0441 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u0442\u0438\u043f\u0430 <a href=\"http:\/\/www.typescriptlang.org\/\">TypeScript<\/a> \u0438\u043b\u0438 <a href=\"http:\/\/scriptsharp.com\/\">ScriptSharp<\/a>;<\/li>\n<li>JohnSmith \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u0438\u0440\u0443\u0435\u0442 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c\u0438 DOM \u0438\u0437 JavaScript-\u043a\u043e\u0434\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u043d \u043d\u0443\u0436\u0434\u0430\u0435\u0442\u0441\u044f \u0432 jQuery.<\/li>\n<\/ul>\n<p>  \u041d\u0430 \u044d\u0442\u043e\u043c \u0432\u0441\u0451, \u0441\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0436\u0434\u0451\u043c \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u0438\u0432\u043d\u043e\u0439 \u043a\u0440\u0438\u0442\u0438\u043a\u0438!    \t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/203890\/\"> http:\/\/habrahabr.ru\/post\/203890\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t<img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/f85\/44f\/bbf\/f8544fbbf739316fa9c3b7984dbbd53b.png\" align=\"left\"\/><\/p>\n<p>  \u041d\u0430 \u0441\u0435\u0433\u043e\u0434\u043d\u044f\u0448\u043d\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043c\u0430\u0441\u0441\u0430 JavaScript-\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f rich-client \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439. \u041a\u0440\u043e\u043c\u0435 \u0432\u0441\u0435\u043c \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0445 Knockout, Angular.JS \u0438 Ember \u0435\u0441\u0442\u044c \u0432\u0435\u043b\u0438\u043a\u043e\u0435 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0434\u0440\u0443\u0433\u0438\u0445 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u0432, \u0438 \u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u043c\u0435\u0435\u0442 \u0441\u0432\u043e\u044e \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u2014 \u043a\u0442\u043e-\u0442\u043e \u043f\u0440\u043e\u043f\u0430\u0433\u0430\u043d\u0434\u0438\u0440\u0443\u0435\u0442 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u0438\u0437\u043c, \u0430 \u043a\u0442\u043e-\u0442\u043e \u2014 \u0438\u0434\u0435\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0447\u0438\u0441\u0442\u043e\u0442\u0443 \u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u0444\u0438\u043b\u043e\u0441\u043e\u0444\u0438\u0438 MVC. \u041f\u0440\u0438 \u0432\u0441\u0451\u043c \u044d\u0442\u043e\u043c \u043c\u043d\u043e\u0433\u043e\u043e\u0431\u0440\u0430\u0437\u0438\u0438, \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e \u043f\u043e\u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0432\u0441\u0451 \u043d\u043e\u0432\u044b\u0435 \u0438 \u043d\u043e\u0432\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438. \u0418\u0437 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e, \u0447\u0442\u043e \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043b\u043e\u0441\u044c \u043d\u0430 \u0445\u0430\u0431\u0440\u0435 \u2014 <a href=\"http:\/\/habrahabr.ru\/post\/198158\/\">Warp9<\/a> \u0438 <a href=\"http:\/\/habrahabr.ru\/post\/196146\/\">Matreshka.js<\/a>. \u0412 \u0441\u0432\u044f\u0437\u0438 \u0441 \u044d\u0442\u0438\u043c \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043e \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u043f\u043e\u0434\u0435\u043b\u043a\u0435, \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0439\u0442\u0435, JohnSmith \u2014 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0438 \u043b\u0435\u0433\u043a\u043e\u0432\u0435\u0441\u043d\u044b\u0439 JavaScript \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u0434\u043b\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f UI.<\/p>\n<p>  <br clear=\"left\"\/>  <\/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-203890","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/203890","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=203890"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/203890\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=203890"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=203890"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=203890"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}