{"id":262964,"date":"2015-08-05T15:38:02","date_gmt":"2015-08-05T11:38:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=262964"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=262964","title":{"rendered":"\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 callback-\u0432\u0438\u0434\u0436\u0435\u0442\u0430 \u043e\u0442 Oblax"},"content":{"rendered":"<p>             \u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0445\u043e\u0447\u0443 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u0440\u043e \u043c\u043e\u0439 callback-\u0432\u0438\u0434\u0436\u0435\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f \u0440\u0435\u0448\u0438\u043b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0434\u043b\u044f \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438! <\/p>\n<p>  \u0421\u0443\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0438 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u043b\u0430\u0441\u044c \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c:  <\/p>\n<ul>\n<li>1. \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u0434\u043b\u044f \u0437\u0430\u043a\u0430\u0437\u0447\u0438\u043a\u0430 \u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u0432\u0438\u0434\u0436\u0435\u0442 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430 \u0441\u0432\u044f\u0437\u0438 <\/li>\n<li>2. \u041e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e \u0438 \u0431\u044b\u0441\u0442\u0440\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0435\u0433\u043e <\/li>\n<li>3. \u0421 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 Cross Domain requests<\/li>\n<li>4. \u0421 \u0431\u044b\u0441\u0442\u0440\u043e\u0439 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u043e\u0439 \u0432 \u043e\u0434\u043d\u0443 \u0441\u0442\u0440\u043e\u0447\u043a\u0443 \u043a\u043e\u0434\u0430<\/li>\n<li>5. \u0411\u044b\u0441\u0442\u0440\u043e \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c\u044b\u0439<\/li>\n<li>6. E-mail \u0440\u0430\u0441\u0441\u044b\u043b\u043a\u0430<\/li>\n<\/ul>\n<p>  \u0420\u0435\u0448\u0435\u043d\u0438\u0435: <\/p>\n<p>  \u041f\u0435\u0440\u0435\u0434 \u0442\u0435\u043c \u043a\u0430\u043a \u043d\u0430\u0447\u0430\u0442\u044c \u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u0434, \u044f \u043f\u0440\u043e\u0434\u0443\u043c\u0430\u043b \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 \u0438 \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0434\u043b\u044f backend \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b php, \u0430 front-end native js + angular \u0431\u0435\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u0440\u0443\u0433\u0438\u0445 <s>jquery-\u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445<\/s> \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a. \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0432\u0438\u0434\u0436\u0435\u0442 \u0431\u044b\u043b \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u043c, \u043a\u0430\u0436\u0434\u044b\u0439 \u0432\u0438\u0434\u0436\u0435\u0442 \u0438\u043c\u0435\u0435\u0442 \u0441\u0432\u043e\u0439 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u043b\u044e\u0447, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043c\u044b \u0438 \u0431\u0443\u0434\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0432\u0441\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e \u0432\u0438\u0434\u0436\u0435\u0442\u0443. <br \/>  <a name=\"habracut\"><\/a><br \/>  \u042f \u043d\u0435 \u0445\u043e\u0447\u0443 \u043f\u0438\u0441\u0430\u0442\u044c \u043e\u0433\u0440\u043e\u043c\u043d\u044b\u0435 \u043a\u0443\u0441\u043a\u0438 \u043a\u043e\u0434\u0430 \u043b\u043e\u0433\u0438\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0432 \u0441\u0438\u043b\u0430\u0445 \u0434\u043e\u0434\u0443\u043c\u0430\u0442\u044c, \u0430 \u0445\u043e\u0442\u0435\u043b \u0431\u044b \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c \u0442\u0435 \u043c\u043e\u043c\u0435\u043d\u0442\u044b, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f \u043f\u043e\u0442\u0440\u0430\u0442\u0438\u043b \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u0441\u0435\u0433\u043e <b>\u0432\u0440\u0435\u043c\u0435\u043d\u0438<\/b>, \u0445\u043e\u0442\u044f \u0438 \u0432 \u0432\u0435\u0431-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0443\u0436\u0435 \u043d\u0435 \u043f\u0435\u0440\u0432\u044b\u0439 \u0433\u043e\u0434. <\/p>\n<p>  \u041f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c \u043a \u0440\u0430\u0437\u0431\u043e\u0440\u0443 \u0443\u0437\u043a\u0438\u0445 \u043c\u0435\u0441\u0442!<\/p>\n<p>  \u041a\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043a\u043e\u0434 \u0434\u043b\u044f \u0432\u0441\u0442\u0430\u0432\u043a\u0438 \u043d\u0430 \u0441\u0430\u0439\u0442 (<s>index.html<\/s>):<\/p>\n<pre><code class=\"javascript\">&lt;script type=&quot;text\/javascript&quot; charset=&quot;utf-8&quot; src=&quot;http:\/\/domain.ru\/widget-get?key=a3234cc36aa23123456a59c281e51e50&quot;&gt;&lt;\/script&gt; <\/code><\/pre>\n<p>  (key \u2014 \u044d\u0442\u043e \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 md5 \u043a\u043b\u044e\u0447, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u044f \u043f\u043e\u043b\u0443\u0447\u0430\u044e \u0432\u0441\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043f\u043e \u0432\u0438\u0434\u0436\u0435\u0442\u0443, \u0430 \u043d\u0435 \u043f\u043e ID \u044d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u0432\u0430\u0436\u043d\u043e, \u0430 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u043c\u043e\u0435 \u043c\u0435\u0441\u0442\u043e \u0432\u0441\u0442\u0430\u0432\u043a\u0438 \u044d\u0442\u043e \u0434\u043e \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u044e\u0449\u0435\u0433\u043e \u0442\u0435\u0433\u0430 &lt;<i>\/body<\/i>&gt;)<\/p>\n<p>  \u041a\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 backend \u043a\u043e\u0434 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u043d\u0430 php, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0442\u0434\u0430\u0451\u0442 \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0434\u043b\u044f \u0432\u0441\u0442\u0430\u0432\u043a\u0438:<\/p>\n<p>  \u041e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a:  <\/p>\n<pre><code class=\"php\">&lt;?php class ControllerWidgetGet extends Controller { \tpublic function index(){         if (isset($this-&gt;request-&gt;get['key'])){             $data['key'] = $this-&gt;db-&gt;escape($this-&gt;request-&gt;get['key']);             if ($row = $this-&gt;checkValidKey($data['key'])){                 $data['row'] = $row;                 $this-&gt;response-&gt;setOutput($this-&gt;load-&gt;view('\/widget\/get.tpl', $data));             }else{                 echo 'alert(&quot;\u041f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0432\u0430\u0448\u0435\u0433\u043e \u043a\u043b\u044e\u0447\u0430&quot;);';             }         }     }      public function checkValidKey($key){         $query_key = $service = $this-&gt;db-&gt;query(&quot;SELECT * FROM `&quot; . DB_PREFIX . &quot;widget` WHERE `key_get` = '&quot; . $key . &quot;'&quot;);         return $query_key-&gt;row;     } } <\/code><\/pre>\n<p>  \u0428\u0430\u0431\u043b\u043e\u043d (get.tpl):  <\/p>\n<pre><code class=\"javascript\">document.write('&lt;link href=&quot;http:\/\/domain.ru\/widget\/production\/tracker.css&quot; rel=&quot;stylesheet&quot;\/&gt;&lt;script src=&quot;http:\/\/yastatic.net\/angularjs\/1.3.16\/angular.min.js&quot;&gt;&lt;\/script&gt;&lt;script src=&quot;http:\/\/domain.ru\/widget\/production\/tracker.js&quot;&gt;&lt;\/script&gt;&lt;div ng-app=&quot;widgetApp&quot;&gt;&lt;widget scolor=&quot;&lt;?=$row['s_color'];?&gt;&quot; spoints=&quot;&lt;?=$row['s_points'];?&gt;&quot; spmenu=&quot;&lt;?=$row['s_p_menu'];?&gt;&quot; spwidget=&quot;&lt;?=$row['s_p_widget'];?&gt;&quot; sworktime=&quot;&lt;?=$row['s_work_time'];?&gt;&quot; key=&quot;&lt;?=$key;?&gt;&quot;&gt;&lt;\/widget&gt;&lt;\/div&gt;'); <\/code><\/pre>\n<p>  \u0433\u0434\u0435:<br \/>  <code> &lt;link href=&quot;http:\/\/domain.ru\/widget\/production\/tracker.css&quot; rel=&quot;stylesheet&quot;\/&gt; - \u043d\u0430\u0448\u0438 \u0441\u0442\u0438\u043b\u0438 <\/code><\/p>\n<p>  <code> &lt;script src=&quot;http:\/\/yastatic.net\/angularjs\/1.3.16\/angular.min.js&quot;&gt;&lt;\/script&gt; - cdn \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 <\/code><\/p>\n<p>  <code> &lt;script src=&quot;http:\/\/domain.ru\/widget\/production\/tracker.js&quot;&gt;&lt;\/script&gt; - \u043b\u043e\u0433\u0438\u043a\u0430 \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f <\/code><\/p>\n<p>  <code> &lt;div ng-app=&quot;widgetApp&quot;&gt;&lt;widget scolor=&quot;&lt;?=$row['s_color'];?&gt;&quot; spoints=&quot;&lt;?=$row['s_points'];?&gt;&quot; spmenu=&quot;&lt;?=$row['s_p_menu'];?&gt;&quot; spwidget=&quot;&lt;?=$row['s_p_widget'];?&gt;&quot; sworktime=&quot;&lt;?=$row['s_work_time'];?&gt;&quot; key=&quot;&lt;?=$key;?&gt;&quot;&gt;&lt;\/widget&gt;&lt;\/div&gt; - \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043d\u0430\u0448\u0435\u0433\u043e angular \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0441 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 \u0432 \u0412\u0438\u0434\u0436\u0435\u0442 <\/code><\/p>\n<p>  \u0427\u0438\u0442\u0430\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u043c\u0430\u043d\u044b(<s>stackoverflow \u0438 \u0434\u0440.<\/s>) \u043f\u043e \u0432\u0441\u0442\u0430\u0432\u043a\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 html \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c js, \u0436\u0435\u043b\u0435\u0437\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e document.write. \u041d\u043e \u043d\u0430 \u044d\u0442\u043e\u043c \u0432\u0441\u044f \u0438\u0441\u0442\u043e\u0440\u0438\u044f \u0435\u0449\u0451 \u043d\u0435 \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f, \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0443 \u043d\u0430\u0441 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043a \u043d\u0430\u043c \u043d\u0430 \u0441\u0430\u0439\u0442 *.css, *.js, \u043d\u043e \u043d\u0430\u043c \u0442\u0430\u043a\u0436\u0435 \u0434\u043b\u044f \u0432\u044b\u0432\u043e\u0434\u0430 \u043d\u0430\u0448\u0435\u0433\u043e \u0432\u0438\u0434\u0436\u0435\u0442\u0430 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043c\u043d\u043e\u0433\u043e html \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0438, \u0438 \u0442\u0443\u0442 \u0441\u0442\u0430\u043b\u0438 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u044c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b!<\/p>\n<p>  \u0414\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u0430 Angular \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 template:<\/p>\n<p>  <b>#1<\/b>  <\/p>\n<pre><code class=\"javascript\">.directive('myDialog', function() {   return {     templateUrl: 'http:\/\/domain.ru\/my-dialog.html'   }; <\/code><\/pre>\n<p>  <b>#2<\/b>  <\/p>\n<pre><code class=\"javascript\">.directive('myDialog', function() {   return {     template: '&lt;div ng-controller=&quot;MyController&quot;&gt;&lt;h1&gt;{{textHello}}&lt;\/h1&gt;&lt;\/div&gt;'   }; <\/code><\/pre>\n<p>  \u041a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439 \u043a #1:<br \/>  \u041d\u0435 \u043a\u0440\u043e\u0441\u0441\u0434\u043e\u043c\u0435\u043d\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435, \u043e\u043d \u0437\u0430\u0431\u0438\u0440\u0430\u0435\u0442 \u043c\u0435\u0442\u043e\u0434\u043e\u043c GET .html \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0443 \u0438 \u0432\u044b\u043f\u0430\u0434\u0430\u044e\u0442 \u043e\u0448\u0438\u0431\u043a\u0438 \u0432\u0438\u0434\u0430:  <\/p>\n<blockquote><p>\u201cNo &#8216;Access-Control-Allow-Origin&#8217; header is present on the requested resource\u201d<\/p><\/blockquote>\n<p>  \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0447\u0442\u043e \u0441\u043a\u0430\u0436\u0435\u0442 \u043d\u0430 \u044d\u0442\u043e <a href=\"http:\/\/stackoverflow.com\/questions\/20035101\/no-access-control-allow-origin-header-is-present-on-the-requested-resource\">stackoverflow<\/a><\/p>\n<p>  \u041a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439 \u043a #2:<br \/>  \u0417\u0434\u0435\u0441\u044c \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0447\u0442\u043e \u0432\u043d\u0443\u0442\u0440\u0438 \u043d\u0430\u0448\u0435\u0433\u043e \/tracker.js \u043c\u044b \u043d\u0435 \u043f\u0440\u0438\u0431\u0435\u0433\u0430\u0435\u043c \u043a \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 html \u0441 \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430, \u0430 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0435\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 template, \u0441\u0443\u043f\u0435\u0440! \u041d\u043e \u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0431\u044b \u043a\u0430\u043a \u0442\u0430\u043a? \u0420\u0430\u0437\u0432\u0435 \u043c\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u0440\u043e\u0441\u0441\u0434\u043e\u043c\u0435\u043d\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u0442\u0438\u043f\u0430 JSONP \u0438 \u0437\u0430\u0431\u0440\u0430\u0442\u044c HTML, \u043f\u043e\u0434\u0443\u043c\u0430\u043b\u0438 \u0432\u044b? \u041d\u0415\u0422! <\/p>\n<p>  \u0421\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u044e\u0434\u0430 <a href=\"http:\/\/stackoverflow.com\/questions\/7531823\/use-jsonp-to-load-an-html-page\">stackoverflow<\/a><\/p>\n<p>  \u041f\u0440\u043e\u0441\u0442\u043e \u0437\u0430\u043c\u0435\u0447\u0442\u0430\u0442\u0435\u043b\u044c\u043d\u043e!<\/p>\n<p>  \u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u043d\u0430\u043f\u043e\u0441\u043b\u0435\u0434\u043e\u043a:<\/p>\n<p>  \u0414\u043b\u044f \u0441\u0436\u0430\u0442\u0438\u044f \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b gulp.js <\/p>\n<pre><code class=\"javascript\">var gulp = require('gulp'),     minifyHTML = require('gulp-minify-html'),     sass = require('gulp-sass'); autoprefixer = require('gulp-autoprefixer'),     minifycss = require('gulp-minify-css'),     rename = require('gulp-rename'),     concat = require('gulp-concat'),     uglify = require('gulp-uglify');  gulp.task('p-ht', function() {     var opts = {         conditionals: true,         spare:true     };     return gulp.src('src\/html\/index.html')         .pipe(minifyHTML(opts))         .pipe(gulp.dest('dest\/html\/')) });  gulp.task('p-st', function() {     \/\/return gulp.src('src\/styles\/main.scss')         \/\/.pipe(sass({style: 'expanded'}))     return gulp.src('src\/styles\/tracker.css')         .pipe(autoprefixer('last 2 version'))         .pipe(gulp.dest('dest\/styles\/'))         \/\/.pipe(rename({suffix: '.min'} ))         .pipe(minifycss())         .pipe(gulp.dest('dest\/styles\/')) });  gulp.task('p-sc', function() {     return gulp.src('src\/scripts\/*.js')         .pipe(concat('tracker.js'))         .pipe(gulp.dest('dest\/scripts\/'))         \/\/.pipe(rename({suffix: '.min'}))         .pipe(uglify())         .pipe(gulp.dest('dest\/scripts\/')) });  gulp.task('watch', function() {     gulp.watch('src\/scripts\/*.js', ['p-sc']) });   gulp.task('dev', ['p-st', 'p-sc', 'watch'], function () {  });  gulp.task('build', ['p-st', 'p-sc', 'p-ht'], function () {  });  <\/code><\/pre>\n<p>  \u041a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439: \u043f\u0440\u0438 \u0441\u0436\u0430\u0442\u0438\u0438 html \u0441\u0438\u043c\u0432\u043e\u043b \u043e\u0434\u0438\u043d\u0430\u0440\u043d\u043e\u0439 \u043a\u0430\u0432\u044b\u0447\u043a\u0438 \u044d\u043a\u0440\u0430\u043d\u0438\u0440\u0443\u0439\u0442\u0435 \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0441 ng-class={\\&#8217;test-class\\&#8217;: expression}, \u0438 \u0441\u043b\u0435\u0434\u0438\u0442\u0435 \u0437\u0430 \u0441\u0438\u043c\u0432\u043e\u043b\u0430\u043c\u0438 \u0432 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u0445, js-\u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440 \u043e\u0431\u044b\u0447\u043d\u043e \u043f\u043e\u0434\u0441\u0432\u0435\u0447\u0438\u0432\u0430\u0435\u0442, \u043f\u043e\u0434\u0441\u0432\u0435\u0447\u0435\u043d\u043d\u044b\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u044d\u043a\u0440\u0430\u043d\u0438\u0440\u0443\u0439\u0442\u0435<\/p>\n<p>  \u0414\u043b\u044f \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u0434\u0430 \u0432 \u0431\u0443\u0444\u0435\u0440 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434, \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0439 \u043d\u0430 <a href=\"http:\/\/stackoverflow.com\/questions\/400212\/how-do-i-copy-to-the-clipboard-in-javascript#answer-30810322\">stackoverflow<\/a><\/p>\n<p>  \u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435:<\/p>\n<p>  \u0425\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c \u0434\u043b\u044f \u0431\u043e\u043b\u0435\u0435 \u0442\u043e\u0447\u043d\u043e\u0433\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f, \u0434\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 \u043b\u044e\u0431\u044b\u0445 \u0441\u0430\u0439\u0442\u0430\u0445, \u0430 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u043c! \u0417\u0430\u043f\u0440\u043e\u0441\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u044f \u043e\u0431\u043c\u0435\u043d\u0438\u0432\u0430\u044e\u0441\u044c \u0441\u043e \u0441\u0432\u043e\u0438\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e <b>JSONP<\/b>!<\/p>\n<p>  \u0412\u0441\u0435\u043c \u0443\u0434\u0430\u0447\u0438 \u0432 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435!             <\/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\/264211\/\"> http:\/\/habrahabr.ru\/post\/264211\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>             \u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0445\u043e\u0447\u0443 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u0440\u043e \u043c\u043e\u0439 callback-\u0432\u0438\u0434\u0436\u0435\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f \u0440\u0435\u0448\u0438\u043b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0434\u043b\u044f \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438! <\/p>\n<p>  \u0421\u0443\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0438 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u043b\u0430\u0441\u044c \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c:  <\/p>\n<ul>\n<li>1. \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u0434\u043b\u044f \u0437\u0430\u043a\u0430\u0437\u0447\u0438\u043a\u0430 \u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u0432\u0438\u0434\u0436\u0435\u0442 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430 \u0441\u0432\u044f\u0437\u0438 <\/li>\n<li>2. \u041e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e \u0438 \u0431\u044b\u0441\u0442\u0440\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0435\u0433\u043e <\/li>\n<li>3. \u0421 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 Cross Domain requests<\/li>\n<li>4. \u0421 \u0431\u044b\u0441\u0442\u0440\u043e\u0439 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u043e\u0439 \u0432 \u043e\u0434\u043d\u0443 \u0441\u0442\u0440\u043e\u0447\u043a\u0443 \u043a\u043e\u0434\u0430<\/li>\n<li>5. \u0411\u044b\u0441\u0442\u0440\u043e \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c\u044b\u0439<\/li>\n<li>6. E-mail \u0440\u0430\u0441\u0441\u044b\u043b\u043a\u0430<\/li>\n<\/ul>\n<p>  \u0420\u0435\u0448\u0435\u043d\u0438\u0435: <\/p>\n<p>  \u041f\u0435\u0440\u0435\u0434 \u0442\u0435\u043c \u043a\u0430\u043a \u043d\u0430\u0447\u0430\u0442\u044c \u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u0434, \u044f \u043f\u0440\u043e\u0434\u0443\u043c\u0430\u043b \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 \u0438 \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0434\u043b\u044f backend \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b php, \u0430 front-end native js + angular \u0431\u0435\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u0440\u0443\u0433\u0438\u0445 <s>jquery-\u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445<\/s> \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a. \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0432\u0438\u0434\u0436\u0435\u0442 \u0431\u044b\u043b \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u043c, \u043a\u0430\u0436\u0434\u044b\u0439 \u0432\u0438\u0434\u0436\u0435\u0442 \u0438\u043c\u0435\u0435\u0442 \u0441\u0432\u043e\u0439 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u043b\u044e\u0447, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043c\u044b \u0438 \u0431\u0443\u0434\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0432\u0441\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e \u0432\u0438\u0434\u0436\u0435\u0442\u0443.   <\/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-262964","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/262964","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=262964"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/262964\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=262964"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=262964"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=262964"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}