{"id":225931,"date":"2014-06-17T16:06:02","date_gmt":"2014-06-17T12:06:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=225931"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=225931","title":{"rendered":"<span class=\"post_title\">ANGULARJS + REQUIREJS<\/span>"},"content":{"rendered":"<div class=\"content html_format\">       <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/cb2\/b25\/f7c\/cb2b25f7c2bedf8996b72e448d286739.jpg\"\/><br \/>  \u0412\u043e \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u043c\u044b \u043f\u043e\u043b\u044e\u0431\u0438\u043b\u0438 AngularJs. \u041d\u043e \u0442\u0430\u043a\u0436\u0435 \u043c\u044b \u0432\u0441\u0442\u0440\u0435\u0442\u0438\u043b\u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0442\u0440\u0443\u0434\u043d\u043e\u0441\u0442\u0438 \u0432 \u0431\u043e\u0440\u044c\u0431\u0435 \u0437\u0430 \u0447\u0438\u0441\u0442\u043e\u0442\u0443 \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 AngularJs \u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0445\u043e\u0440\u043e\u0448\u043e, \u043d\u043e \u0432\u0441\u0435 \u0436\u0435 \u043f\u043e\u0440\u043e\u0439 \u0435\u043c\u0443 \u0447\u0435\u0433\u043e-\u0442\u043e \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u0435\u0442. RequireJs \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u043c \u0442\u0430\u043c, \u0433\u0434\u0435 AngularJs \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0436\u0435\u043b\u0430\u0442\u044c \u043b\u0443\u0447\u0448\u0435\u0433\u043e, \u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0438\u0445 \u0432\u043c\u0435\u0441\u0442\u0435 \u2014 \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430.<\/p>\n<p>  \u0418\u0442\u0430\u043a, \u043e\u043f\u0438\u0448\u0435\u043c \u043d\u0430\u0448 \u0432\u0437\u0433\u043b\u044f\u0434 \u043d\u0430 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b.<\/p>\n<h5>\u0414\u043b\u044f \u0447\u0435\u0433\u043e?<\/h5>\n<p>  \u0420\u0430\u0431\u043e\u0442\u0430\u044f \u0441 AngularJs \u0432\u044b \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0437\u0430\u0434\u0443\u043c\u0430\u0435\u0442\u0435\u0441\u044c \u043e \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0439 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u0434\u0430. \u041a\u043e\u043d\u0435\u0447\u043d\u043e \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u0443\u0447\u0438\u0442\u044c <a href=\"http:\/\/briantford.com\/blog\/huuuuuge-angular-apps.html\">\u0442\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u043e\u0441\u0442 \u0411\u0440\u0430\u0439\u0430\u043d\u0430 \u0424\u043e\u0440\u0434\u0430<\/a> \u0438\u043b\u0438 <a href=\"http:\/\/cliffmeyers.com\/blog\/2013\/4\/21\/code-organization-angularjs-javascript\">\u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e \u041a\u043b\u0438\u0444\u0444\u0430 \u041c\u0435\u0439\u0435\u0440\u0441\u0430<\/a>. \u042f \u0436\u0435 \u043f\u043e\u0434\u0435\u043b\u044e\u0441\u044c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u0434\u0430 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445 AngularJs \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c RequireJs.<\/p>\n<p>  \u0414\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u0435\u043d, \u0435\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435:<\/p>\n<ul>\n<li>\u043f\u0435\u0440\u0435\u0441\u0442\u0430\u0442\u044c \u0431\u0435\u0441\u043f\u043e\u043a\u043e\u0438\u0442\u044c\u0441\u044f \u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u0432 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435;<\/li>\n<li>\u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c javascript \u043a\u043e\u0434 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e;<\/li>\n<li>\u0438\u043c\u0435\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u0434 \u0432 \u043e\u0434\u0438\u043d \u043c\u0438\u043d\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 JS-\u0444\u0430\u0439\u043b;<\/li>\n<\/ul>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<h5>\u0414\u043b\u044f \u043a\u043e\u0433\u043e?<\/h5>\n<p>  \u041f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0432\u044b \u0443\u0436\u0435 \u0437\u043d\u0430\u0435\u0442\u0435 \u043e\u0441\u043d\u043e\u0432\u044b AngularJs, \u0430 \u0442\u0430\u043a \u0436\u0435 \u043f\u043e \u043a\u0440\u0430\u0439\u043d\u0435\u0439 \u043c\u0435\u0440\u0435 \u0437\u043d\u0430\u043a\u043e\u043c\u044b \u0441 \u043f\u043e\u0434\u0445\u043e\u0434\u043e\u043c AMD \u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 RequireJs. \u0427\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0434\u0445\u043e\u0434, \u044f \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0443 RequireJs \u0434\u043b\u044f <a href=\"https:\/\/github.com\/angular\/angular-seed\">Angular Seed<\/a> \u0438 \u043e\u043f\u0438\u0448\u0443 \u0432\u043d\u043e\u0441\u0438\u043c\u044b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f. Angular Seed \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0440\u0443\u0435\u0442 \u043a\u043e\u0434, \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u044f \u0444\u0430\u0439\u043b\u044b \u043f\u043e \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e. \u0422\u0430\u043a\u0438\u043c \u0436\u0435 \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043f\u043e\u0441\u0442\u0443\u043f\u043b\u044e \u0438 \u044f.<\/p>\n<h5>\u041a\u0430\u043a?<\/h5>\n<p>  <\/p>\n<h6>Angular Seed Project<\/h6>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u043c\u0441\u044f \u0441\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439 \u043a\u043e\u0434\u0430 \u0432 Angular Seed. \u0412\u0437\u0433\u043b\u044f\u043d\u0438\u0442\u0435 \u043d\u0430 \u043a\u043e\u0434 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043d\u0430 <a href=\"https:\/\/github.com\/StarterSquad\/startersquad.github.com\/tree\/master\/examples\/angularjs-requirejs-1\">github<\/a>:<\/p>\n<ul>\n<li><code>app.js<\/code> \u0444\u0430\u0439\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/li>\n<li>\u0441\u0430\u043c\u0438 \u0444\u0430\u0439\u043b\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u2014 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u044b (controllers), \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u044b (directives), \u0444\u0438\u043b\u044c\u0442\u0440\u044b (filters), \u0441\u0435\u0440\u0432\u0438\u0441\u044b (services). <\/li>\n<li><code>index.html<\/code> \u0441 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u044b\u043c\u0438 JS-\u0444\u0430\u0439\u043b\u0430\u043c\u0438 \u0432 \u043d\u0443\u0436\u043d\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435.<\/li>\n<li>\u0438\u043b\u0438 <code>index-async.html<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 angular-loader.js \u0438\u043b\u0438 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u0447\u0438\u043a\u0438, \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e. <\/li>\n<\/ul>\n<p>  \u0427\u0442\u043e \u0436, \u043d\u0430\u0447\u043d\u0435\u043c.<\/p>\n<h6>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c RequireJs<\/h6>\n<p>  \u0412\u0437\u0433\u043b\u044f\u043d\u0438\u0442\u0435 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440 \u0432 <a href=\"http:\/\/www.startersquad.com\/examples\/angularjs-requirejs-2\/\">\u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435<\/a> \u0438\u043b\u0438 \u043d\u0430 <a href=\"https:\/\/github.com\/StarterSquad\/startersquad.github.com\/tree\/master\/examples\/angularjs-requirejs-2\">github<\/a>.<\/p>\n<h6>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439<\/h6>\n<p>  \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b <a href=\"http:\/\/bower.io\/\">bower<\/a>. \u041a\u043e\u0434 <code>bower.json<\/code>:  <\/p>\n<pre><code class=\"javascript\"> {     &quot;name&quot;: &quot;AngularJS + RequireJS Example&quot;,     &quot;version&quot;: &quot;0.1&quot;,     &quot;main&quot;: &quot;index.html&quot;,     &quot;ignore&quot;: [       &quot;**\/.*&quot;,       &quot;libs&quot;     ],     &quot;dependencies&quot;: {      &quot;angular&quot;: &quot;latest&quot;,      &quot;requirejs&quot;: &quot;latest&quot;,      &quot;requirejs-domready&quot;: &quot;latest&quot;    }  } <\/code><\/pre>\n<p>  \u041f\u043e\u043b\u043e\u0436\u0438\u0442\u0435 \u0444\u0430\u0439\u043b <code>.bowerrc<\/code> \u0440\u044f\u0434\u043e\u043c \u0441 <code>bower.json<\/code> \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 <code>bower install<\/code>. \u0422\u0435\u043f\u0435\u0440\u044c \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 <code>libs<\/code>.<\/p>\n<p>  <b>index.html<\/b><\/p>\n<p>  \u0420\u0430\u0437\u0440\u0443\u0448\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u0445\u043e\u0440\u043e\u0448\u0438\u043c \u043d\u0430\u0447\u0430\u043b\u043e\u043c! \u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 <code>index.html<\/code> \u0438 \u0443\u0434\u0430\u043b\u0438\u0442\u0435 \u0432\u0441\u0435 \u0442\u0435\u0433\u0438 <code>&lt;script&gt;<\/code>. \u0412\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0447\u0438\u0449\u0435, \u043d\u0435 \u0442\u0430\u043a \u043b\u0438? \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u0435 \u043e\u0434\u0438\u043d \u0441\u043a\u0440\u0438\u043f\u0442 \u043f\u0435\u0440\u0435\u0434 \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u044e\u0449\u0438\u043c \u0442\u0435\u0433\u043e\u043c <code>&lt;\/body&gt;<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 RequireJs, \u0438 \u043f\u043e\u0440\u0443\u0447\u0438\u0442 \u0435\u0439 \u0438\u0441\u043a\u0430\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u0432 \u0444\u0430\u0439\u043b\u0435 <code>js\/main.js<\/code>, \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u043c \u0432 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0435 <code>data-main<\/code> \u0442\u0435\u0433\u0430 <code>&lt;script&gt;<\/code>:<\/p>\n<pre><code class=\"html\">&lt;!doctype html&gt;  &lt;html lang=&quot;en&quot;&gt;  &lt;head&gt;    &lt;meta charset=&quot;utf-8&quot;&gt;    &lt;title&gt;My AngularJS AngularJS + RequireJS App&lt;\/title&gt;    &lt;link rel=&quot;stylesheet&quot; href=&quot;css\/app.css&quot;&gt;  &lt;\/head&gt;  &lt;body&gt;    &lt;ul class=&quot;menu&quot;&gt;      &lt;li&gt;&lt;a href=&quot;#\/view1&quot;&gt;view1&lt;\/a&gt;&lt;\/li&gt;      &lt;li&gt;&lt;a href=&quot;#\/view2&quot;&gt;view2&lt;\/a&gt;&lt;\/li&gt;    &lt;\/ul&gt;      &lt;div data-ng-view&gt;&lt;\/div&gt;      &lt;div&gt;Angular Require seed app: v&lt;span app-version&gt;&lt;\/span&gt;&lt;\/div&gt;     &lt;script src=&quot;lib\/requirejs\/require.js&quot; data-main=&quot;js\/main.js&quot;&gt;&lt;\/script&gt;  &lt;\/body&gt; &lt;\/html&gt; <\/code><\/pre>\n<p>  \u042d\u0442\u043e \u0432\u0441\u0435 \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e. \u0417\u0430\u043a\u0440\u043e\u0439\u0442\u0435 \u0444\u0430\u0439\u043b <code>index.html<\/code>, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043e\u043d \u043d\u0430\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f.<\/p>\n<p>  <b>main.js<\/b><\/p>\n<p>  \u041f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c \u043a \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0430\u0446\u0438\u0438 RequireJS.<\/p>\n<pre><code class=\"javascript\">require.config({        \/\/  \u043f\u0441\u0435\u0432\u0434\u043e\u043d\u0438\u043c\u044b \u0438 \u043f\u0443\u0442\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0438 \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432      paths: {          'domReady': '..\/lib\/requirejs-domready\/domReady',          'angular': '..\/lib\/angular\/angular'      },        \/\/ angular \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 AMD \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u043f\u0435\u0440\u043c\u0435\u043d\u043d\u0443\u044e angular \u0432 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0443\u044e \u043e\u0431\u043b\u0430\u0441\u0442\u044c      shim: {          'angular': {              exports: 'angular'          }      },        \/\/ \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435      deps: ['.\/bootstrap'] }); <\/code><\/pre>\n<p>  \u0427\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u043e? <\/p>\n<p>  \u0412 \u0431\u043b\u043e\u043a\u0435 <code>paths<\/code> \u043c\u044b \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043f\u0441\u0435\u0432\u0434\u043e\u043d\u0438\u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0438 \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432. \u0414\u0430\u043b\u0435\u0435 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0447\u0442\u043e AngularJs \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0432\u0438\u0434\u0435\u043d \u0432 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438 (\u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0431\u043b\u043e\u043a <a href=\"http:\/\/requirejs.org\/docs\/api.html#config-shim\">shim<\/a>). \u0422\u0430\u043a \u0436\u0435 \u0443\u043a\u0430\u0437\u044b\u0430\u0432\u0435\u043c, \u0447\u0442\u043e \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d<code> bootstrap.js<\/code>.<\/p>\n<p>  <b>bootstrap.js<\/b><\/p>\n<p>  \u0421\u0435\u0439\u0447\u0430\u0441 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c AngularJs, \u0438\u043c\u0435\u043d\u043d\u043e \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0444\u0430\u0439\u043b <code>bootstrap.js<\/code> (\u043e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0432\u0430\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>ng-app<\/code> \u0432 HTML \u043a\u043e\u0434\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f). \u041f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u043d\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f <code>routes.js<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u043e\u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0435\u0433\u043e \u0432 \u0441\u043f\u0438\u0441\u043e\u043a \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439.<\/p>\n<p>  \u0417\u0430\u043c\u0435\u0442\u044c\u0442\u0435, \u0447\u0442\u043e \u0432 \u044d\u0442\u043e\u043c \u043c\u043e\u0434\u0443\u043b\u0435 \u043c\u044b \u043f\u043e\u0447\u0442\u0438 \u043d\u0435 \u0438\u043c\u0435\u0435\u043c \u0434\u0435\u043b\u043e \u0441 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0439 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u043e\u0439, \u0438 \u0446\u0435\u043f\u043e\u0447\u043a\u0430 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u0443\u0434\u0435\u0442<br \/>  <code>angular-&gt;app-&gt;routes<\/code> \u0442\u0430\u043a \u043a\u0430\u043a \u043e\u043d\u0438 \u0437\u0430\u0432\u0438\u0441\u044f\u0442 \u043e\u0442 \u0434\u0440\u0443\u0433 \u0434\u0440\u0443\u0433\u0430: AngularJs \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c \u0434\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043c\u043e\u0434\u0443\u043b\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f (app) \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u0436\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u043e\u0432 (routes).<\/p>\n<pre><code class=\"javascript\"> \/**   * bootstraps angular onto the window.document node   *\/  define([      'require',      'angular',      'app',      'routes'  ], function (require, ng) {      'use strict';        require(['domReady!'], function (document) {          ng.bootstrap(document, ['app']);      }); }); <\/code><\/pre>\n<p>  \u041c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043c\u043e\u0434\u0443\u043b\u044c <code>domReady<\/code>, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0435\u0434 \u0437\u0430\u043f\u0443\u0441\u043a\u043e\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e DOM \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d. \u0422\u0430\u043a\u0436\u0435 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c <code>app.js<\/code>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0441\u043d\u043e\u0432\u043e\u0439 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<p>  <b>app.js<\/b><\/p>\n<p>  <code>app.js<\/code> \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u044f \u0432\u0435\u0440\u0445\u043d\u0435\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f \u0438 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0435\u0433\u043e \u043f\u043e\u0434\u043c\u043e\u0434\u0443\u043b\u0435\u0439.<\/p>\n<pre><code class=\"javascript\">define([      'angular',      '.\/controllers\/index',      '.\/directives\/index',      '.\/filters\/index',      '.\/services\/index'  ], function (ng) {      'use strict';        return ng.module('app', [          'app.services',          'app.controllers',          'app.filters',          'app.directives'      ]); }); <\/code><\/pre>\n<p>  \u041c\u044b \u0443\u0441\u043b\u043e\u0432\u0438\u043b\u0438\u0441\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0447\u0435\u0442\u044b\u0440\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u043c\u043e\u0434\u0443\u043b\u044f: \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u044b (controllers), \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u044b (directives), \u0444\u0438\u043b\u044c\u0442\u0440\u044b (filters), \u0441\u0435\u0440\u0432\u0438\u0441\u044b (services). \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c, \u0447\u0442\u043e \u044d\u0442\u0438 \u043c\u043e\u0434\u0443\u043b\u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u044b \u0434\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f.<\/p>\n<p>  <b>routes.js<\/b><\/p>\n<p>  \u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u043e\u0432 (routes) \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432 \u044d\u0442\u043e\u043c \u0444\u0430\u0439\u043b\u0435. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u044b \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 (\u044d\u0442\u043e\u0442 \u0441\u043b\u0443\u0447\u0430\u0439 \u0432\u044b\u0445\u043e\u0434\u0438\u0442 \u0437\u0430 \u0440\u0430\u043c\u043a\u0438 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438). <\/p>\n<pre><code class=\"javascript\">define(['.\/app'], function (app) {      'use strict';      return app.config(['$routeProvider', function ($routeProvider) {          $routeProvider.when('\/view1', {              templateUrl: 'partials\/partial1.html',              controller: 'MyCtrl1'          });            $routeProvider.when('\/view2', {              templateUrl: 'partials\/partial2.html',              controller: 'MyCtrl2'          });            $routeProvider.otherwise({              redirectTo: '\/view1'          });      }]); }); <\/code><\/pre>\n<p>  \u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043c\u043e\u0434\u0443\u043b\u044f<\/p>\n<p>  \u041c\u043e\u0434\u0443\u043b\u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u0442 \u0438\u0437 \u0442\u0440\u0435\u0445 \u0447\u0430\u0441\u0442\u0435\u0439:<\/p>\n<ul>\n<li>\u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u044f<\/li>\n<li>\u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442<\/li>\n<li>\u0437\u0430\u0433\u0440\u0443\u0437\u0447\u0438\u043a<\/li>\n<\/ul>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043c\u043e\u0434\u0443\u043b\u044c <code>app.controllers<\/code> \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430.<\/p>\n<p>  \u041e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u044f <b>controllers\/module.js<\/b><\/p>\n<pre><code class=\"javascript\">define(['angular'], function (ng) {     'use strict';     return ng.module('app.controllers', []); }); <\/code><\/pre>\n<p>  \u042d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u043c\u0438 \u043c\u043e\u0434\u0443\u043b\u044f \u0434\u043b\u044f \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0441\u0430\u043c\u0438\u0445 \u0441\u0435\u0431\u044f (\u0441\u043c. \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0447\u0430\u0441\u0442\u044c)<\/p>\n<p>  \u0417\u0430\u0433\u0440\u0443\u0437\u0447\u0438\u043a \u043c\u043e\u0434\u0443\u043b\u044f <b>controllers\/index.js<\/b><\/p>\n<p>  \u042d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0443\u0441\u0442\u043e\u0439 \u0431\u043b\u043e\u043a define, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u044f \u0432\u0441\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u043c\u043e\u0434\u0443\u043b\u044f. \u0417\u0434\u0435\u0441\u044c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u0442\u044c \u0444\u0430\u0439\u043b module.js \u0442\u0430\u043a \u043a\u0430\u043a \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0448\u0435\u043d \u0441\u0430\u043c\u0438\u043c\u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u043c\u0438 (\u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430\u043c\u0438). \u0417\u0430\u0433\u0440\u0443\u0437\u0447\u0438\u043a \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u0432\u0435\u0440\u0445\u043d\u0435\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f \u043c\u043e\u0434\u0443\u043b\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0435\u043c\u0443 RequireJs \u0437\u043d\u0430\u0435\u0442 \u043a\u0430\u043a\u0438\u0435 \u0444\u0430\u0439\u043b\u044b \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c.<\/p>\n<pre><code class=\"javascript\">define([     '.\/my-ctrl-1',     '.\/my-ctrl-2' ], function () {}); <\/code><\/pre>\n<p>  \u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u043c\u043e\u0434\u0443\u043b\u044f <b>controllers\/my-ctrl-1.js<\/b><\/p>\n<p>  \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 \u043c\u043e\u0434\u0443\u043b\u0435\u043c \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 <code>app.controllers<\/code> \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u043c\u0438 \u0431\u0443\u0434\u0443\u0442 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u041f\u0440\u0438\u043c\u0435\u0440 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430:<\/p>\n<pre><code class=\"javascript\">define(['.\/module'], function (controllers) {     'use strict';     controllers.controller('MyCtrl1', [function ($scope) {}]); }); <\/code><\/pre>\n<p>  \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 <code>.\/module.js<\/code> \u0434\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u044c \u0438 \u043f\u0440\u0438\u0441\u043e\u0435\u0434\u0438\u043d\u0438\u0442\u044c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u043a \u043c\u043e\u0434\u0443\u043b\u044e.<\/p>\n<p>  \u0412\u044b\u0432\u043e\u0434\u044b:<\/p>\n<p>  \u0412\u043e\u0442 \u0438 \u0432\u0441\u0435. \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u0438\u043c\u0435\u0435\u043c \u0440\u0430\u0431\u043e\u0447\u0435\u0435 AngularJs \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u043d\u0430 RequireJs. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0441\u043b\u0430\u0436\u0434\u0430\u0442\u044c\u0441\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u043e\u0439 \u043d\u0435 \u043e\u0431\u0440\u0430\u0449\u0430\u044f \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u043d\u0430 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0432\u0430\u0448\u0438\u0445 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432, \u0430 \u0442\u0430\u043a\u0436\u0435 \u044d\u0442\u043e\u0442 \u043f\u043e\u0434\u0445\u043e\u0434 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0432\u0430\u043c \u0441 \u043b\u0435\u0433\u043a\u043e\u0441\u0442\u044c\u044e \u043c\u0438\u043d\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u0442\u044c \u0432\u0441\u0435 \u0444\u0430\u0439\u043b\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432 \u043e\u0434\u0438\u043d.   \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\/225931\/\"> http:\/\/habrahabr.ru\/post\/225931\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">       <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/cb2\/b25\/f7c\/cb2b25f7c2bedf8996b72e448d286739.jpg\"\/><br \/>  \u0412\u043e \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u043c\u044b \u043f\u043e\u043b\u044e\u0431\u0438\u043b\u0438 AngularJs. \u041d\u043e \u0442\u0430\u043a\u0436\u0435 \u043c\u044b \u0432\u0441\u0442\u0440\u0435\u0442\u0438\u043b\u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0442\u0440\u0443\u0434\u043d\u043e\u0441\u0442\u0438 \u0432 \u0431\u043e\u0440\u044c\u0431\u0435 \u0437\u0430 \u0447\u0438\u0441\u0442\u043e\u0442\u0443 \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 AngularJs \u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0445\u043e\u0440\u043e\u0448\u043e, \u043d\u043e \u0432\u0441\u0435 \u0436\u0435 \u043f\u043e\u0440\u043e\u0439 \u0435\u043c\u0443 \u0447\u0435\u0433\u043e-\u0442\u043e \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u0435\u0442. RequireJs \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u043c \u0442\u0430\u043c, \u0433\u0434\u0435 AngularJs \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0436\u0435\u043b\u0430\u0442\u044c \u043b\u0443\u0447\u0448\u0435\u0433\u043e, \u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0438\u0445 \u0432\u043c\u0435\u0441\u0442\u0435 \u2014 \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430.<\/p>\n<p>  \u0418\u0442\u0430\u043a, \u043e\u043f\u0438\u0448\u0435\u043c \u043d\u0430\u0448 \u0432\u0437\u0433\u043b\u044f\u0434 \u043d\u0430 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b.<\/p>\n<h5>\u0414\u043b\u044f \u0447\u0435\u0433\u043e?<\/h5>\n<p>  \u0420\u0430\u0431\u043e\u0442\u0430\u044f \u0441 AngularJs \u0432\u044b \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0437\u0430\u0434\u0443\u043c\u0430\u0435\u0442\u0435\u0441\u044c \u043e \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0439 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u0434\u0430. \u041a\u043e\u043d\u0435\u0447\u043d\u043e \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u0443\u0447\u0438\u0442\u044c <a href=\"http:\/\/briantford.com\/blog\/huuuuuge-angular-apps.html\">\u0442\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u043e\u0441\u0442 \u0411\u0440\u0430\u0439\u0430\u043d\u0430 \u0424\u043e\u0440\u0434\u0430<\/a> \u0438\u043b\u0438 <a href=\"http:\/\/cliffmeyers.com\/blog\/2013\/4\/21\/code-organization-angularjs-javascript\">\u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e \u041a\u043b\u0438\u0444\u0444\u0430 \u041c\u0435\u0439\u0435\u0440\u0441\u0430<\/a>. \u042f \u0436\u0435 \u043f\u043e\u0434\u0435\u043b\u044e\u0441\u044c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u0434\u0430 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445 AngularJs \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c RequireJs.<\/p>\n<p>  \u0414\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u0435\u043d, \u0435\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435:<\/p>\n<ul>\n<li>\u043f\u0435\u0440\u0435\u0441\u0442\u0430\u0442\u044c \u0431\u0435\u0441\u043f\u043e\u043a\u043e\u0438\u0442\u044c\u0441\u044f \u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u0432 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435;<\/li>\n<li>\u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c javascript \u043a\u043e\u0434 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e;<\/li>\n<li>\u0438\u043c\u0435\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u0434 \u0432 \u043e\u0434\u0438\u043d \u043c\u0438\u043d\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 JS-\u0444\u0430\u0439\u043b;<\/li>\n<\/ul>\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-225931","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/225931","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=225931"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/225931\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=225931"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=225931"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=225931"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}