{"id":188406,"date":"2013-07-31T13:22:06","date_gmt":"2013-07-31T09:22:06","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=188406"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=188406","title":{"rendered":"<span class=\"post_title\">CoffeeScript \u0438 AngularJS<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t<i>\u041f\u0435\u0440\u0435\u0432\u043e\u0434 \u0441\u0442\u0430\u0442\u044c\u0438 \u0410\u043b\u0435\u043a\u0441\u0430\u043d\u0434\u0440\u0430 \u0425\u0438\u043b\u043b\u0430 <a href=\"http:\/\/alxhill.com\/blog\/articles\/angular-coffeescript\/\">CoffeeScript and AngularJS<\/a>. \u042d\u0442\u043e \u043c\u043e\u0439 \u043f\u0435\u0440\u0432\u044b\u0439 \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u0438 \u0431\u0443\u0434\u0443 \u0440\u0430\u0434 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043b\u044e\u0431\u044b\u0435 \u0437\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u044f \u0438 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f.<\/i><\/p>\n<p>  AngularJS \u0438 CoffeeScript \u044d\u0442\u043e \u043e\u0442\u043b\u0438\u0447\u043d\u0430\u044f \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u044f, \u043d\u0435 \u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e CoffeeScript \u043d\u0435 \u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0441\u0442\u044c\u044e \u0432 \u043a\u043e\u043c\u044c\u044e\u043d\u0438\u0442\u0438 AngularJS. \u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u0435\u043c\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u00ab\u043e\u0431\u043b\u0435\u0433\u0447\u0430\u0442\u00bb \u0432\u0430\u0448 \u043a\u043e\u0434 \u043d\u0430 AngularJS.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h4>\u041a\u043e\u0440\u043e\u0442\u043a\u0430\u044f \u0437\u0430\u043f\u0438\u0441\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438<\/h4>\n<p>  \u0412 Angular \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u0430\u043d\u043e\u043d\u0438\u043c\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u0438 \u043a\u0430\u043a \u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043a\u043e\u0440\u043e\u0442\u043a\u0443\u044e \u0437\u0430\u043f\u0438\u0441\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043c\u043e\u0436\u043d\u043e \u0441\u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442\u044c \u0443\u0439\u043c\u0443 \u0432\u0440\u0435\u043c\u0435\u043d\u0438. \u041a\u0430\u043a \u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u0443 <i>&#8216;enter key&#8217;<\/i>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u044f\u0435\u0442 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043f\u043e \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043d\u0430 \u043a\u043b\u0430\u0432\u0438\u0448\u0443 <i>Enter<\/i> \u0441 \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u043e\u0439. \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u044d\u0442\u0430 \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u0430 \u043d\u0435 \u043d\u0435\u0441\u0435\u0442 \u0432 \u0441\u0435\u0431\u0435 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0437\u043d\u0430\u0447\u0438\u043c\u043e\u0441\u0442\u0438, \u043d\u043e \u0434\u043e\u043b\u0436\u043d\u0430 \u0434\u0430\u0442\u044c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0442 AngularJS \u0438 CoffeeScript.<br \/>  \u0418\u0442\u0430\u043a, \u043a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c:  <\/p>\n<pre><code class=\"html\">&lt;input enter-key=&quot;submit()&quot; enter-key-delay=&quot;10&quot; \/&gt; <\/code><\/pre>\n<p>  JavaScript \u043a\u043e\u0434:  <\/p>\n<pre><code class=\"javascript\">app.directive('enterKey', function ($timeout) {   return function (scope, elem, attrs) {     elem.bind('keydown', function (e) {       if (e.keyCode === 13) {         $timeout(function () {           scope.$apply(attrs.enterKey);         }, +attrs.enterKeyDelay);       }     });   } }); <\/code><\/pre>\n<p>  \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u0435 \u0435\u0433\u043e \u0441 CoffeeScript:  <\/p>\n<pre><code class=\"javascript\">app.directive 'enterKey', ($timeout) -&gt;   (scope, elem, attrs) -&gt;     elem.bind 'keydown', (e) -&gt;       if e.keyCode is 13         $timeout -&gt;           scope.$apply attrs.enterKey         , +attrs.enterKeyDelay <\/code><\/pre>\n<p>  \u0412 CoffeeScript \u0441\u0438\u043c\u0432\u043e\u043b <i>-&gt;<\/i> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438, \u0437\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u044b\u043c\u0438 \u0432 \u043a\u0440\u0443\u0433\u043b\u044b\u0435 \u0441\u043a\u043e\u0431\u043a\u0438 \u043f\u0435\u0440\u0435\u0434 \u043d\u0435\u0439. \u0415\u0441\u043b\u0438 \u0436\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432, \u0442\u043e \u0441\u043a\u043e\u0431\u043a\u0438 \u043d\u0435 \u043d\u0443\u0436\u043d\u044b, \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u043c \u0441\u043b\u0443\u0436\u0438\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u0430\u044f \u0432 $timeout. <br \/>  \u041c\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430 <i>function<\/i> 4 \u0440\u0430\u0437\u0430 \u0432 10 \u0441\u0442\u0440\u043e\u0447\u043a\u0430\u0445 \u043a\u043e\u0434\u0430, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043a\u043e\u0434 \u0441\u0442\u0430\u043b \u0431\u043e\u043b\u0435\u0435 \u0447\u0438\u0442\u0430\u0435\u043c\u044b\u043c \u0438 \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u043b\u043e\u0441\u044c \u0432\u0440\u0435\u043c\u044f \u0434\u043b\u044f \u0435\u0433\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f. \u0422\u0430\u043a\u0436\u0435 \u043d\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 <i>return<\/i>, \u0442.\u043a. CoffeeScript(\u043a\u0430\u043a \u0438 Ruby) \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438.<\/p>\n<h4>Automatic Returns<\/h4>\n<p>  \u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 (\u0438\u043b\u0438 \u043d\u0435\u044f\u0432\u043d\u044b\u0439) \u0432\u043e\u0437\u0432\u0440\u0430\u0442 \u2014 \u044d\u0442\u043e \u0435\u0449\u0435 \u043e\u0434\u043d\u043e \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u043e, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0434\u0435\u043b\u0430\u0435\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 Angular \u043a\u043e\u0434\u0430 \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u0438 \u043f\u0440\u043e\u0449\u0435. \u041d\u0438\u0436\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0433\u0434\u0435 \u0432\u0438\u0434\u043d\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0441\u0442\u044c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0442\u0430. \u0420\u0430\u0437\u043d\u0438\u0446\u0430, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u043d\u0435 \u0431\u043e\u043b\u044c\u0448\u0430\u044f, \u043d\u043e \u0432 \u0431\u043e\u043b\u044c\u0448\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043c\u0435\u0442\u043d\u0430.<\/p>\n<h5>\u0424\u0438\u043b\u044c\u0442\u0440\u044b<\/h5>\n<p>  <\/p>\n<pre><code class=\"javascript\">app.filter('capitalise', function (str) {   return str.charAt(0).toUpperCase() + str.slice(1); }); <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"javascript\">app.filter 'capitalise', (str) -&gt; str.charAt(0) + str[1..] <\/code><\/pre>\n<p>  \u0411\u043e\u043d\u0443\u0441\u043e\u043c \u0432 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0447\u0430\u0441\u0442\u0438 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 <i>str.slice(1) vs. str[1..]<\/i>.<\/p>\n<h5>\u0424\u0430\u0431\u0440\u0438\u043a\u0438<\/h5>\n<p>  <\/p>\n<pre><code class=\"javascript\">app.factory('urlify', function (text) {   \/\/ nb: \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u044d\u0442\u043e \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445   return text.toLowerCase().replace(&quot; &quot;, &quot;&quot;); }); <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"javascript\">app.factory 'urlify', (text) -&gt; text.toLowerCase().replace &quot; &quot;, &quot;&quot; <\/code><\/pre>\n<p>  <\/p>\n<h5>\u0414\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u044b (\u043e\u043f\u044f\u0442\u044c)<\/h5>\n<p>  \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u0443 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u0430. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0442\u0430 CoffeeScript, \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u043e\u0433\u043e \u0441\u0442\u0438\u043b\u044f YAML \u0438 \u043a\u043e\u0440\u043e\u0442\u043a\u0443\u044e \u0437\u0430\u043f\u0438\u0441\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u0435\u043b\u0430\u0435\u0442 \u043a\u043e\u0434 \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u0431\u043e\u043b\u0435\u0435 \u0447\u0438\u0442\u0430\u0435\u043c\u044b\u043c. \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0432\u0437\u044f\u0442 \u0441 <a href=\"http:\/\/docs.angularjs.org\/guide\/directive\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 AngularJS<\/a>.   <\/p>\n<pre><code class=\"javascript\">app.directive('directiveName', function factory(injectables) {   return {     priority: 0,     template: '&lt;div&gt;&lt;\/div&gt;',     templateUrl: 'directive.html',     replace: false,     transclude: false,     restrict: 'A',     scope: false,     controller: function ($scope, $element, $attrs, $transclude, otherInjectables) { ... },     compile: function compile(tElement, tAttrs, transclude) {       return {         pre: function preLink(scope, iElement, iAttrs, controller) { ... },         post: function postLink(scope, iElement, iAttrs, controller) { ... }       }     },     link: function postLink(scope, iElement, iAttrs) { ... }   } }); <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"javascript\">app.directive 'directiveName', (injectables) -&gt;   priority: 0   template: '&lt;div&gt;&lt;\/div&gt;'   templateUrl: 'directive.html'   replace: false   transclude: false   restrict: 'A'   scope: false   controller: ($scope, $element, $attrs, $transclude, otherInjectables) -&gt; ...   compile: (tElement, tAttrs, transclude) -&gt;     pre: (scope, iElement, iAttrs, controller) -&gt; ...     post: (scope, iElement, iAttrs, controller) -&gt; ...   link: (scope, iElement, iAttrs) -&gt; ... <\/code><\/pre>\n<p>  \u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0432\u043e\u0437\u0432\u0440\u0430\u0442 \u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u043a\u0430\u043a \u0434\u043b\u044f \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u0430, \u0442\u0430\u043a \u0438 \u0432\u043d\u0443\u0442\u0440\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <i>compile<\/i>.<\/p>\n<h5>\u041a\u043b\u0430\u0441\u0441\u044b<\/h5>\n<p>  \u0412 CoffeeScript \u043a\u043b\u0430\u0441\u0441\u044b \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u0438\u044f\u0442\u043d\u044b\u043c\u0438 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u0432 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u044f\u0437\u044b\u043a\u0430. \u0412\u043e\u0442 \u043a\u0430\u043a \u043e\u043d\u0438 \u0432\u044b\u0433\u043b\u044f\u0434\u044f\u0442:  <\/p>\n<pre><code class=\"javascript\">class Animal   constructor: (@name) -&gt;    move: (meters) -&gt;     alert @name + &quot; moved #{meters}m.&quot;  snake = new Animal('snake')  snake.move(10) # alerts &quot;snake moved 10m.&quot; <\/code><\/pre>\n<p>  \u0412 CoffeeScript \u0441\u0438\u043c\u0432\u043e\u043b <i>@<\/i> \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u043e\u0440\u043e\u0442\u043a\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u044c\u044e \u0434\u043b\u044f <i>this<\/i>. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 <i><code>@name<\/code><\/i> \u0441\u0442\u0430\u043d\u0435\u0442 <i>this.name<\/i>. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u0430 <i>@<\/i> \u043a \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0435\u0433\u043e \u043a <i>this<\/i>, \u043a\u0430\u043a \u0432\u0438\u0434\u043d\u043e \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0435 Animal.<br \/>  \u0412\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u043d\u0430 JavaScript. \u041e\u043d, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u043d\u0435 \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u0435\u043d <a href=\"http:\/\/coffeescript.org\/#try:class%20Animal%0A%20constructor%3A%20(%40name)%20-%3E%0A%0A%20move%3A%20(meters)%20-%3E%0A%20%20alert%20%40name%20%2B%20%22%20moved%20%23%7Bmeters%7Dm.%22%0A%0Asnake%20%3D%20new%20Animal(&#39;snake&#39;)%0Asnake.move(10)\">\u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u043c\u0443<\/a> \u043a\u043e\u0434\u0443 CoffeeScript, \u043d\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u0435\u043d.  <\/p>\n<pre><code class=\"javascript\">function Animal(name) {   this.name = name; }  Animal.prototype.move = function (meters) {   alert(this.name + &quot;moved&quot; + meters + &quot;m.&quot;) }  var snake = new Animal('snake')  snake.move(10) \/\/ alerts &quot;snake moved 10m.&quot;, as before <\/code><\/pre>\n<p>  CoffeeScript \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u043c\u0435\u0442\u043e\u0434\u044b \u043a \u0435\u0435 <i>prototype<\/i>. \u0412 Angular \u044d\u0442\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u0432 \u0434\u0432\u0443\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445: \u0432 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u0445 \u0438 \u0441 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u043e\u043c <i>new Controller<\/i>.<\/p>\n<h5>\u0421\u0435\u0440\u0432\u0438\u0441\u044b<\/h5>\n<p>  \u0412 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0444\u0430\u0431\u0440\u0438\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0430 \u0432 \u0434\u0440\u0443\u0433\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0432\u043d\u0430\u0447\u0430\u043b\u0435 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d \u0435\u0433\u043e \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043f\u0435\u0440\u0435\u0434 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c. \u0411\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0435 \u043e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u0435 \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u0439 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0432 <a href=\"http:\/\/iffycan.blogspot.co.uk\/2013\/05\/angular-service-or-factory.html\">\u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435<\/a>.<br \/>  \u0418\u0437 \u0441\u0442\u0430\u0442\u044c\u0438, \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u043e\u0439 \u0432\u044b\u0448\u0435, \u0432\u0437\u044f\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u0441\u0435\u0440\u0432\u0438\u0441\u0430:  <\/p>\n<pre><code class=\"javascript\">var gandalf = angular.module('gandalf', []);  function Gandalf() {   this.color = 'grey'; } Gandalf.prototype.comeBack = function () {   this.color = 'white'; }  gandalf.service('gandalfService', Gandalf);  var injector = angular.injector(['gandalf', 'ng']);  injector.invoke(function (gandalfService) {   console.log(gandalfService.color);   gandalfService.comeBack()   console.log(gandalfService.color); }); <\/code><\/pre>\n<p>  \u0412\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043a\u0430\u043a JavaScript \u043a\u043e\u0434, \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0438\u0437 \u043a\u043b\u0430\u0441\u0441\u0430 CoffeeScript. \u041f\u043e\u044d\u0442\u043e\u043c\u0443, \u0432\u043c\u0435\u0441\u0442\u043e \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f <i>prototype<\/i> \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043b\u0430\u0441\u0441 CoffeeScript:  <\/p>\n<pre><code class=\"javascript\">gandalf = angular.module 'gandalf', []  gandalf.service 'gandalfService',   class Gandalf     constructor: -&gt; @color = 'grey'     comeBack: -&gt; @color = 'white'  injector = angular.injector ['gandalf', 'ng']  injector.invoke (gandalfService) -&gt;   console.log gandalfService.color   gandalfService.comeBack()   console.log gandalfService.color <\/code><\/pre>\n<p>  \u0417\u0434\u0435\u0441\u044c \u043c\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u043a\u043b\u0430\u0441\u0441 \u0432 \u0441\u0435\u0440\u0432\u0438\u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u044e. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0435\u0433\u043e \u0434\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0438 \u0443\u0436\u0435 \u0437\u0430\u0442\u0435\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0432 \u0441\u0435\u0440\u0432\u0438\u0441, \u043d\u043e \u044f \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0438\u0442\u0430\u044e \u0447\u0442\u043e\u0431\u044b \u043a\u043b\u0430\u0441\u0441 \u0431\u044b\u043b \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0447\u0435\u0440\u0435\u0437 \u0441\u0435\u0440\u0432\u0438\u0441.<br \/>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c <i>gandalf<\/i>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u00ab\u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f\u00bb \u0441 \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u043e\u0439, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f <i>$timeout<\/i> \u0441\u0435\u0440\u0432\u0438\u0441.  <\/p>\n<pre><code class=\"javascript\">gandalf.service 'gandalfService',   class Gandalf     constructor: (@$timeout) -&gt; @color = 'grey'     comeBack: (time) -&gt;       # '\u0434\u0432\u043e\u0439\u043d\u0430\u044f \u0441\u0442\u0440\u0435\u043b\u043a\u0430' \u0432 coffeescript \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0441 \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c       # \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c 'this', \u043f\u043e\u044d\u0442\u043e\u043c\u0443 @color - \u044d\u0442\u043e \u0442\u0430 \u0436\u0435 \u0441\u0430\u043c\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f, \u0447\u0442\u043e \u0438 \u0432\u044b\u0448\u0435.       @$timeout =&gt;         @color = 'white'       , time <\/code><\/pre>\n<p>  \u0418\u043c\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0432 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430\u0445 \u0431\u0443\u0434\u0435\u0442 <i>$timeout<\/i>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 Angular \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c. \u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u043a \u043e\u0431\u044a\u0435\u043a\u0442\u0443 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0430\u043c \u0438\u043c\u0435\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043d\u0438\u043c \u0432 \u043c\u0435\u0442\u043e\u0434\u0430\u0445, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 <i>comeBack<\/i>.<\/p>\n<h5>\u041a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u044b<\/h5>\n<p>  \u0412 AngularJS 1.1.5 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u043d\u043e\u0432\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c <a href=\"http:\/\/www.egghead.io\/video\/tTihyXaz4Bo\">\u0432\u0438\u0434\u0435\u043e<\/a> \u0434\u043b\u044f \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0435\u0439, \u043d\u043e \u043f\u043e \u0441\u0443\u0442\u0438 \u043d\u043e\u0432\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043a\u043b\u0430\u0441\u0441\u0443 \u0431\u044b\u0442\u044c \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u043c \u043a\u0430\u043a \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440, \u0430 \u043d\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0441 \u043e\u0431\u043b\u0430\u0441\u0442\u044c\u044e \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 html-\u043a\u043e\u0434 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 todoList \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 AngularJS \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:  <\/p>\n<pre><code class=\"html\">&lt;body ng-app=&quot;todoApp&quot;&gt;   &lt;div ng-controller=&quot;TodoCtrl as todos&quot;&gt;     &lt;span&gt;{{todos.remaining()}} of {{todos.list.length}} remaining&lt;\/span&gt;     [&lt;a href=&quot;&quot; ng-click=&quot;todos.archive()&quot;&gt;archive&lt;\/a&gt;]     &lt;ul&gt;       &lt;li ng-repeat=&quot;todo in todos.list&quot;&gt;         &lt;input type=&quot;checkbox&quot; ng-model=&quot;todo.done&quot;&gt;         &lt;span class=&quot;done-{{todo.done}}&quot;&gt;{{todo.text}}&lt;\/span&gt;       &lt;\/li&gt;     &lt;\/ul&gt;     &lt;form ng-submit=&quot;todos.addTodo()&quot;&gt;       &lt;input type=&quot;text&quot; ng-model=&quot;todos.input&quot; placeholder=&quot;add a new todo&quot;&gt;       &lt;input type=&quot;submit&quot; value=&quot;add&quot;&gt;     &lt;\/form&gt;   &lt;\/div&gt; &lt;\/body&gt; <\/code><\/pre>\n<p>  \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 CoffeeScript \u043a\u043b\u0430\u0441\u0441 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430:  <\/p>\n<pre><code class=\"javascript\">app = angular.module 'todoApp', []  app.controller 'TodoCtrl',   class TodoCtrl     list: [       text: &quot;learn coffescript&quot;       done: false     ,       text: &quot;learn angular&quot;       done: true     ]      addTodo: -&gt;       @list.push         text: @input         done: false       @input = ''      remaining: -&gt;       count = 0       for todo in @list         count += if todo.done then 0 else 1       count      archive: -&gt;       oldList = @list       @list = []       for todo in oldList         unless todo.done           @list.push todo <\/code><\/pre>\n<p>  <\/p>\n<h4>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h4>\n<p>  \u041a\u0430\u043a \u0432\u044b \u043c\u043e\u0433\u043b\u0438 \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, CoffeeScript \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u0439 \u043a\u043e\u043c\u043f\u0430\u043d\u044c\u043e\u043d \u0434\u043b\u044f AngularJS. \u0425\u043e\u0442\u044f \u043d\u0435 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u043e \u0437\u0430\u043f\u0438\u0441\u0438 CoffeeScript \u043f\u0435\u0440\u0435\u0432\u0435\u0448\u0438\u0432\u0430\u0435\u0442 \u0435\u0433\u043e \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0438.<br \/>  \u0415\u0441\u0442\u044c \u0446\u0435\u043b\u044b\u0439 \u0440\u044f\u0434 \u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u044f \u043d\u0435 \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u043b \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a: <a href=\"http:\/\/coffeescript.org\/#literals\">\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e<\/a>, <a href=\"http:\/\/coffeescript.org\/#operators\">\u044d\u043a\u0437\u0438\u0441\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440<\/a>, <a href=\"http:\/\/coffeescript.org\/#loops\">\u043c\u0430\u0441\u0441\u0438\u0432\u044b \u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u044b<\/a>. \u0412\u0441\u0435 \u044d\u0442\u043e \u0432\u043c\u0435\u0441\u0442\u0435 \u0434\u0435\u043b\u0430\u0435\u0442 CoffeeScript \u043f\u0440\u0438\u044f\u0442\u043d\u044b\u043c \u0438 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0438\u0432\u043d\u044b\u043c \u044f\u0437\u044b\u043a\u043e\u043c \u0434\u043b\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c. \u0415\u0441\u043b\u0438 \u0432\u044b \u0435\u0449\u0435 \u043d\u0435 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u043b\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f, \u043f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u043d\u0430 <a href=\"http:\/\/coffeescript.org\/\">\u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u0430\u0439\u0442<\/a> \u0437\u0430 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u044f\u043c\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\/188406\/\"> http:\/\/habrahabr.ru\/post\/188406\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t<i>\u041f\u0435\u0440\u0435\u0432\u043e\u0434 \u0441\u0442\u0430\u0442\u044c\u0438 \u0410\u043b\u0435\u043a\u0441\u0430\u043d\u0434\u0440\u0430 \u0425\u0438\u043b\u043b\u0430 <a href=\"http:\/\/alxhill.com\/blog\/articles\/angular-coffeescript\/\">CoffeeScript and AngularJS<\/a>. \u042d\u0442\u043e \u043c\u043e\u0439 \u043f\u0435\u0440\u0432\u044b\u0439 \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u0438 \u0431\u0443\u0434\u0443 \u0440\u0430\u0434 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043b\u044e\u0431\u044b\u0435 \u0437\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u044f \u0438 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f.<\/i><\/p>\n<p>  AngularJS \u0438 CoffeeScript \u044d\u0442\u043e \u043e\u0442\u043b\u0438\u0447\u043d\u0430\u044f \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u044f, \u043d\u0435 \u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e CoffeeScript \u043d\u0435 \u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0441\u0442\u044c\u044e \u0432 \u043a\u043e\u043c\u044c\u044e\u043d\u0438\u0442\u0438 AngularJS. \u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u0435\u043c\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u00ab\u043e\u0431\u043b\u0435\u0433\u0447\u0430\u0442\u00bb \u0432\u0430\u0448 \u043a\u043e\u0434 \u043d\u0430 AngularJS.  <\/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-188406","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/188406","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=188406"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/188406\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=188406"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=188406"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=188406"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}