{"id":268457,"date":"2015-11-18T14:43:10","date_gmt":"2015-11-18T11:43:10","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=268457"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=268457","title":{"rendered":"\u041f\u0443\u0442\u0435\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c \u043f\u043e Bootstrap + Ember.js. \u0427\u0430\u0441\u0442\u044c 1: \u041c\u043e\u0434\u0430\u043b\u044c\u043d\u044b\u0435 \u043e\u043a\u043d\u0430 \u0432 \u042d\u043c\u0431\u0435\u0440\u0435 \u0438\u043b\u0438 \u043a\u0430\u043a \u043f\u043e\u0434\u0440\u0443\u0436\u0438\u0442\u044c Bootstrap Modal \u0438 Ember.js"},"content":{"rendered":"<p>       \u0415\u0441\u043b\u0438 \u0432\u044b \u043b\u044e\u0431\u0438\u0442\u0435 Bootstrap, \u0430\u043a\u0442\u0438\u0432\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 \u0435\u0433\u043e \u0432 \u0440\u0430\u0431\u043e\u0442\u0435 \u0438 \u0440\u0435\u0448\u0438\u043b\u0438 \u0441 \u0433\u043e\u043b\u043e\u0432\u043e\u0439 \u043e\u043a\u0443\u043d\u0443\u0442\u044c\u0441\u044f \u0432 \u043c\u0438\u0440 ember.js, \u0442\u043e \u0432\u0430\u0441 \u043e\u0436\u0438\u0434\u0430\u0435\u0442 \u0443\u0432\u043b\u0435\u043a\u0430\u0442\u0435\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0435 \u043f\u0443\u0442\u0435\u0448\u0435\u0441\u0442\u0432\u0438\u0435 \u043f\u043e \u0437\u0430\u043a\u043e\u0443\u043b\u043a\u0430\u043c Stack Overflow \u0432 \u043f\u043e\u0438\u0441\u043a\u0430\u0445 \u043e\u0442\u0432\u0435\u0442\u043e\u0432 \u043d\u0430 \u0434\u0435\u0441\u044f\u0442\u043a\u0438 \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432. \u041c\u043e\u0439 \u043f\u0443\u0442\u0435\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c <s>\u043f\u043e \u0433\u0430\u043b\u0430\u043a\u0442\u0438\u043a\u0435<\/s> \u043f\u043e Ember.js \u0441\u043f\u043e\u0441\u043e\u0431\u0435\u043d \u0434\u0430\u0442\u044c \u043e\u0442\u0432\u0435\u0442 \u043d\u0430 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0437 \u043d\u0438\u0445, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440: <\/p>\n<p>  <b>\u041a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0430\u043b\u044c\u043d\u044b\u0435 \u043e\u043a\u043d\u0430 Bootstrap \u0432 Ember.js?<\/b><\/p>\n<p>  \u041f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043a \u043e\u0442\u0432\u0435\u0442\u0443, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u044d\u0444\u0444\u0435\u043a\u0442\u043d\u043e\u0435 \u0432\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043c\u043e\u0435\u0433\u043e \u043f\u0443\u0442\u0435\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044f \u0432 \u0446\u0435\u043b\u043e\u043c. \u041d\u0435\u0434\u043e\u043b\u0433\u043e \u0434\u0443\u043c\u0430\u044f \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u043b\u0438\u0441\u044c \u0434\u0432\u0430 \u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0445 \u0441\u043b\u043e\u0432\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435\u043f\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0430\u0442 \u0442\u0435\u0445, \u043a\u0442\u043e \u0445\u043e\u0447\u0435\u0442 \u043f\u043e\u043a\u043e\u0440\u0438\u0442\u044c <s>\u0432\u0441\u0435\u043b\u0435\u043d\u043d\u0443\u044e<\/s> ember.js<\/p>\n<p>  \u00abDON&#8217;T PANIC!\u00bb <\/p>\n<p>  \u0425\u043e\u0440\u043e\u0448\u0435\u0435, \u043d\u0430\u0447\u0430\u043b\u043e. \u041f\u043e\u0435\u0445\u0430\u043b\u0438! <br \/>  <a name=\"habracut\"><\/a><br \/>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u0438\u043a\u0438\u043d\u0435\u043c, \u0447\u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u0447\u0435\u0441\u0442\u044c \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u043c\u043e\u0434\u0430\u043b\u044c\u043d\u044b\u0445 \u043e\u043a\u043e\u043d:<\/p>\n<ol>\n<li>\u043f\u0440\u043e\u0441\u0442\u0430\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u0432 \u043b\u044e\u0431\u044b\u0435 \u0447\u0430\u0441\u0442\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/li>\n<li>\u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0432 \u043c\u043e\u0434\u0430\u043b\u044c\u043d\u044b\u0435 \u043e\u043a\u043d\u0430, \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 <\/li>\n<li>\u0440\u0435\u0433\u0443\u043b\u0438\u0440\u043e\u0432\u043a\u0430 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u0432 \u0438 \u0441\u0442\u0438\u043b\u0435\u0439 \u043c\u043e\u0434\u0430\u043b\u044c\u043d\u044b\u0445 \u043e\u043a\u043e\u043d <\/li>\n<\/ol>\n<p>  \u041c\u043e\u0434\u0430\u043b\u044c\u043d\u043e\u0435 \u043e\u043a\u043d\u043e \u0431\u0443\u0434\u0435\u043c \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 {{outlet &#8216;modal&#8217;}}. \u041a \u043f\u0440\u0438\u043c\u0435\u0440\u0443 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0435\u0441\u0435\u043d \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \/songs. \u0422\u0435\u043c\u043f\u043b\u0435\u0439\u0442 \u0434\u043b\u044f \/songs \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<pre><code class=\"javascript\">\/\/ templates\/songs \/*\u0412\u0430\u0448 \u043a\u043e\u0434*\/  {{outlet 'modal'}} \/\/ \u043c\u0435\u0441\u0442\u043e \u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043c\u043e\u0434\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u043a\u043d\u0430 <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 modal-window.hbs \u0438 \u0432\u044b\u043d\u0435\u0441\u0442\u0438 \u0432 \u043d\u0435\u0433\u043e \u0432\u0441\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0448\u0430\u043f\u043a\u0438 \u0438 \u0444\u0443\u0442\u0435\u0440\u0430 \u043c\u043e\u0434\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u043a\u043d\u0430.<\/p>\n<pre><code class=\"bash\">ember generate component modal-window <\/code><\/pre>\n<p>  \u0412 \u043d\u0435\u043c \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"html\">\/templates\/components\/modal-window.hbs &lt;div class=&quot;modal fade&quot;&gt;   &lt;div class=&quot;modal-dialog {{size}}&quot;&gt;    \/\/ {{size}} - \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0434\u043b\u044f \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043c\u043e\u0434\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u043a\u043d\u0430     &lt;div class=&quot;modal-content&quot;&gt;       &lt;div class=&quot;modal-header&quot;&gt;         &lt;button type=&quot;button&quot; class=&quot;close&quot; data-dismiss=&quot;modal&quot; aria-hidden=&quot;true&quot;&gt;&times;&lt;\/button&gt;         &lt;h4 class=&quot;modal-title&quot;&gt;{{title}}&lt;\/h4&gt;   \/\/\u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438       &lt;\/div&gt;       &lt;div class=&quot;modal-body&quot;&gt;          {{yield}}                                       \/\/ \u0441\u044e\u0434\u0430 \u0431\u0443\u0434\u0435\u043c \u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u043d\u0442 \u043c\u043e\u0434\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u043a\u043d\u0430       &lt;\/div&gt;       &lt;div class=&quot;modal-footer&quot;&gt;         &lt;button type=&quot;button&quot; class=&quot;btn btn-default&quot; data-dismiss=&quot;modal&quot;&gt;\u0417\u0430\u043a\u0440\u044b\u0442\u044c&lt;\/button&gt;         &lt;button type=&quot;button&quot; class=&quot;btn btn-primary&quot; {{action 'save'}}&gt;\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f&lt;\/button&gt;       &lt;\/div&gt;     &lt;\/div&gt;&lt;!-- \/.modal-content --&gt;   &lt;\/div&gt;&lt;!-- \/.modal-dialog --&gt; &lt;\/div&gt;&lt;!-- \/.modal --&gt; <\/code><\/pre>\n<p>  \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e {{size}}. \u0412 \u043d\u0435\u0435 \u0431\u0443\u0434\u0435\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u043a\u043b\u0430\u0441\u0441 \u0434\u043b\u044f \u0440\u0435\u0433\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u043c\u043e\u0434\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u043a\u043d\u0430 (modal-sm, modal-lg). \u041f\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043a\u043b\u0430\u0441\u0441\u044b \u043a \u043b\u044e\u0431\u043e\u043c\u0443 \u0434\u0440\u0443\u0433\u043e\u043c\u0443 \u0431\u043b\u043e\u043a\u0443. <\/p>\n<p>  {{yield}} \u2014 \u044d\u0442\u043e \u0442\u043e \u043c\u0435\u0441\u0442\u043e, \u0433\u0434\u0435 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c\u0441\u044f \u043e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043c\u043e\u0434\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u043a\u043d\u0430. \u041a \u043d\u0435\u0439 \u0432\u0435\u0440\u043d\u0435\u043c\u0441\u044f \u0447\u0443\u0442\u044c \u043f\u043e\u0437\u0436\u0435. \u0415\u0441\u043b\u0438 \u0432\u044b \u043d\u0435 \u0437\u043d\u0430\u0435\u0442\u0435, \u043a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b, \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 \u043e\u0444.\u0433\u0430\u0439\u0434\u043e\u043c \u043c\u043e\u0436\u043d\u043e <a href=\"http:\/\/guides.emberjs.com\/v1.10.0\/components\/\">\u0442\u0443\u0442<\/a>.<\/p>\n<p>  \u041d\u0435\u043f\u043b\u043e\u0445\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0441\u0440\u0430\u0437\u0443 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0434\u043b\u044f \u043a\u043d\u043e\u043f\u043e\u043a \u00ab\u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c\u00bb \u0438 \u00ab\u0437\u0430\u043a\u0440\u044b\u0442\u044c\u00bb, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u044b \u0432 \u0444\u0443\u0442\u0435\u0440\u0435 \u043c\u043e\u0434\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u043a\u043d\u0430. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u043a\u043b\u0430\u0441\u0441 \u043d\u0430\u0448\u0435\u0433\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 components\/modal-window.js \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"javascript\">\/\/components\/modal-window.js   actions: {     save: function() {                                               this.$('.modal').modal('hide');                          this.sendAction('save');                               }   },   show: function() {     this.$('.modal').modal().on('hidden.bs.modal', function() {       this.sendAction('close');     }.bind(this));   }.on('didInsertElement')                                \/\/\u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0441\u0430\u043c\u043e\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435.<\/p>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u043e\u0432\u044b\u0439 \u0442\u0435\u043c\u043f\u043b\u0435\u0439\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c\u0441\u044f \u0432 {{yield}} \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0432\u044b\u0448\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u0438 \u043e\u043d \u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c\u0441\u044f \u0432 {{outlet &#8216;modal&#8217;}}<\/p>\n<pre><code class=\"bash\">ember generate template modals\/song <\/code><\/pre>\n<p>  \u0412\u0441\u0442\u0430\u0432\u0438\u043c \u0442\u0443\u0434\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434<\/p>\n<pre><code class=\"javascript\">\/\/templates\/modals\/song.hbs {{#modal-window title=&quot;\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u0435\u0441\u043d\u044e&quot; size=&quot;modal-sm&quot; save='save' close='removeModal'}}                     &lt;form {{action 'save' on='submit'}}&gt;                         {{input type=&quot;text&quot; value=name class=&quot;form-control&quot;}}                         {{input type=&quot;text&quot; class=&quot;form-control&quot; value=fromServ}}                     &lt;\/form&gt; {{\/modal-window}} <\/code><\/pre>\n<p>  \u041c\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u043b\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0443 (title, size, save, close). \u0422\u0435\u043f\u0435\u0440\u044c \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0442\u0435\u043c\u043f\u043b\u0435\u0439\u0442\u0430:<\/p>\n<pre><code class=\"bash\">ember generate controller modals\/song <\/code><\/pre>\n<p>  \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0442\u0443\u0434\u0430 \u044d\u043a\u0448\u0435\u043d \u0434\u043b\u044f \u043a\u043d\u043e\u043f\u043a\u0438 \u00absave\u00bb:<\/p>\n<pre><code class=\"javascript\">\/\/ controlers\/modals\/song    actions: {     save: function() {       \/\/ \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435     }   } <\/code><\/pre>\n<p>  \u0417\u0430\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u044d\u0442\u0430\u043f \u2014 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043a\u0430\u043a\u043e\u0439 \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0435\u043c\u043f\u043b\u0435\u0439\u0442 \u0441 \u043a\u0430\u043a\u0438\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 \u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0432 {{outlet &#8216;modal&#8217;}}. <\/p>\n<p>  \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0447\u0435\u0440\u0435\u0437 \u043a\u043d\u043e\u043f\u043a\u0443 \u0432\u044b\u0437\u043e\u0432\u0430 \u043c\u043e\u0434\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u043a\u043d\u0430:<\/p>\n<pre><code class=\"html\">\/\/ templates\/songs - \u0442\u0435\u043c\u043f\u043b\u0435\u0439\u0442 \u0434\u043b\u044f \u0432\u044b\u0432\u043e\u0434\u0430 \u0441\u043f\u0438\u0441\u043a\u0430 \u043f\u0435\u0441\u0435\u043d  \/*\u0412\u0430\u0448 \u043a\u043e\u0434*\/  &lt;button {{    action 'showModal' \/\/\u044d\u0442\u043e\u0442 \u044d\u043a\u0448\u0435\u043d \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0434\u0430\u043b\u0435\u0435    'modals\/song' \/\/\u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u043d\u0443\u0436\u043d\u044b\u0439 \u0442\u0435\u043c\u043f\u043b\u0435\u0439\u0442     model \/\/\u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u043d\u0443\u0436\u043d\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c }}&gt;    \u0420\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c &lt;\/button&gt;  {{outlet 'modal'}} \/\/ \u043c\u0435\u0441\u0442\u043e \u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043c\u043e\u0434\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u043a\u043d\u0430 <\/code><\/pre>\n<p>  \u0417\u0430\u0442\u0435\u043c \u0432\u0435\u0448\u0430\u0435\u043c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0434\u043b\u044f &#8216;showModal&#8217; \u043f\u0440\u044f\u043c\u043e \u0432 route \u0442\u0435\u043c\u043f\u043b\u0435\u0439\u0442\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f {{outlet &#8216;modal&#8217;}}, \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e routes\/songs:<\/p>\n<pre><code class=\"javascript\">\/\/routes\/songs \tactions: {            showModal: function(name, model) { \t      this.render(name, { \t        into: 'songs', \t        outlet: 'modal', \t        model: model \t      }); \t    }, \t    removeModal: function() { \t      this.disconnectOutlet({ \t        outlet: 'modal', \t        parentView: 'songs' \t      }); \t    },   \t} <\/code><\/pre>\n<p>  \u0415\u0449\u0435 \u0440\u0430\u0437 \u043e \u0433\u043b\u0430\u0432\u043d\u043e\u043c. <\/p>\n<p>  \u041f\u043e \u043d\u0430\u0436\u0430\u0442\u0438\u044e \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0443 \u0432\u044b\u0437\u043e\u0432\u0430 \u043c\u043e\u0434\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u043a\u043d\u0430 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b:<\/p>\n<ol>\n<li> action &#8216;showModal&#8217; \u2014 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0432 \u0440\u0430\u0443\u0442\u0435 \u0442\u043e\u0433\u043e \u0442\u0435\u043c\u043f\u043b\u0435\u0439\u0442\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0445\u043e\u0442\u0438\u043c \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u043c\u043e\u0434\u0430\u043b\u044c\u043d\u043e\u0435 \u043e\u043a\u043d\u043e<\/li>\n<li> &#8216;modals\/song&#8217; \u2014 \u0442\u0435\u043c\u043f\u043b\u0435\u0439\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u043c \u043c\u043e\u0434\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u043a\u043d\u0430 <\/li>\n<li> model \u2014 \u043c\u043e\u0434\u0435\u043b\u044c \u0434\u043b\u044f \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043c\u043e\u0434\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u043a\u043d\u0430<\/li>\n<\/ol>\n<p>  \u0417\u0430\u0442\u0435\u043c \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043c\u0435\u0442\u043e\u0434 showModal, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043c\u0435\u0449\u0430\u0435\u0442 \u0442\u0435\u043c\u043f\u043b\u0435\u0439\u0442 \u043c\u043e\u0434\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u043a\u043d\u0430 \u0441 \u043d\u0443\u0436\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u044c\u044e \u0432 {{outlet: &#8216;modal&#8217;}}<br \/>  \u0412 \u0442\u0435\u043c\u043f\u043b\u0435\u0439\u0442\u0435 \u043c\u043e\u0434\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u043a\u043d\u0430 \u043f\u043e\u0434\u0433\u0440\u0443\u0436\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u043c\u043e\u0434\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u043a\u043d\u0430, \u0430 \u0432 \u043c\u0435\u0441\u0442\u0435 \u0441 \u043d\u0438\u043c \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f show, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442 \u043c\u043e\u0434\u0430\u043b\u044c\u043d\u043e\u0435 \u043e\u043a\u043d\u043e \u043d\u0430 \u044d\u043a\u0440\u0430\u043d\u0435.<\/p>\n<p>  \u0413\u043e\u0442\u043e\u0432\u043e! \u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435.<\/p>\n<p>  P.S.: \u0421\u043f\u0430\u0441\u0438\u0431\u043e <a href=\"https:\/\/twitter.com\/EmberGuru\">EmberGuru<\/a> \u0437\u0430 \u0438\u0434\u0435\u044e.       <\/p>\n<div class=\"clear\"><\/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\/271153\/\"> http:\/\/habrahabr.ru\/post\/271153\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>       \u0415\u0441\u043b\u0438 \u0432\u044b \u043b\u044e\u0431\u0438\u0442\u0435 Bootstrap, \u0430\u043a\u0442\u0438\u0432\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 \u0435\u0433\u043e \u0432 \u0440\u0430\u0431\u043e\u0442\u0435 \u0438 \u0440\u0435\u0448\u0438\u043b\u0438 \u0441 \u0433\u043e\u043b\u043e\u0432\u043e\u0439 \u043e\u043a\u0443\u043d\u0443\u0442\u044c\u0441\u044f \u0432 \u043c\u0438\u0440 ember.js, \u0442\u043e \u0432\u0430\u0441 \u043e\u0436\u0438\u0434\u0430\u0435\u0442 \u0443\u0432\u043b\u0435\u043a\u0430\u0442\u0435\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0435 \u043f\u0443\u0442\u0435\u0448\u0435\u0441\u0442\u0432\u0438\u0435 \u043f\u043e \u0437\u0430\u043a\u043e\u0443\u043b\u043a\u0430\u043c Stack Overflow \u0432 \u043f\u043e\u0438\u0441\u043a\u0430\u0445 \u043e\u0442\u0432\u0435\u0442\u043e\u0432 \u043d\u0430 \u0434\u0435\u0441\u044f\u0442\u043a\u0438 \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432. \u041c\u043e\u0439 \u043f\u0443\u0442\u0435\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c <s>\u043f\u043e \u0433\u0430\u043b\u0430\u043a\u0442\u0438\u043a\u0435<\/s> \u043f\u043e Ember.js \u0441\u043f\u043e\u0441\u043e\u0431\u0435\u043d \u0434\u0430\u0442\u044c \u043e\u0442\u0432\u0435\u0442 \u043d\u0430 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0437 \u043d\u0438\u0445, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440: <\/p>\n<p>  <b>\u041a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0430\u043b\u044c\u043d\u044b\u0435 \u043e\u043a\u043d\u0430 Bootstrap \u0432 Ember.js?<\/b><\/p>\n<p>  \u041f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043a \u043e\u0442\u0432\u0435\u0442\u0443, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u044d\u0444\u0444\u0435\u043a\u0442\u043d\u043e\u0435 \u0432\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043c\u043e\u0435\u0433\u043e \u043f\u0443\u0442\u0435\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044f \u0432 \u0446\u0435\u043b\u043e\u043c. \u041d\u0435\u0434\u043e\u043b\u0433\u043e \u0434\u0443\u043c\u0430\u044f \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u043b\u0438\u0441\u044c \u0434\u0432\u0430 \u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0445 \u0441\u043b\u043e\u0432\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435\u043f\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0430\u0442 \u0442\u0435\u0445, \u043a\u0442\u043e \u0445\u043e\u0447\u0435\u0442 \u043f\u043e\u043a\u043e\u0440\u0438\u0442\u044c <s>\u0432\u0441\u0435\u043b\u0435\u043d\u043d\u0443\u044e<\/s> ember.js<\/p>\n<p>  \u00abDON&#8217;T PANIC!\u00bb <\/p>\n<p>  \u0425\u043e\u0440\u043e\u0448\u0435\u0435, \u043d\u0430\u0447\u0430\u043b\u043e. \u041f\u043e\u0435\u0445\u0430\u043b\u0438!   <\/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-268457","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/268457","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=268457"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/268457\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=268457"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=268457"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=268457"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}