{"id":282937,"date":"2016-12-23T12:55:10","date_gmt":"2016-12-23T09:55:10","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=282937"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=282937","title":{"rendered":"Yii2 RESTful API-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0434\u043b\u044f AngularJS"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/f68\/9ed\/aef\/f689edaef537484ea81d4eccb80fcc6d.png\"\/><br \/>  \u0417\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u0439\u0442\u0435, \u0434\u043e\u0440\u043e\u0433\u0438\u0435 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u0438!<\/p>\n<p>  \u0421\u0443\u0434\u044f \u043f\u043e \u0432\u0430\u0448\u0438\u043c \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u043c \u043a <a href=\"https:\/\/habrahabr.ru\/post\/308948\/\">\u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u043c \u0441\u0442\u0430\u0442\u044c\u044f\u043c<\/a>, \u043c\u043d\u043e\u0433\u0438\u043c \u0438\u0437 \u0432\u0430\u0441 \u043e\u0447\u0435\u043d\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u043a\u0430\u043a \u0438\u043c\u0435\u043d\u043d\u043e \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c AngularJS \u0432 \u0441\u0432\u044f\u0437\u043a\u0435 \u0441 \u043d\u0430\u0448\u0438\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 Yii2 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0435. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043f\u043e\u0434\u043d\u0438\u043c\u0443 \u0437\u0430\u043d\u0430\u0432\u0435\u0441 \u0438 \u043e\u043f\u0438\u0448\u0443 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 AngularJS \u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u0435\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f.<a name=\"habracut\"><\/a><\/p>\n<p>  \u042f \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Yii2 \u0434\u043b\u044f \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043c\u0430\u0441\u0441\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043d\u043e Angular \u044f \u0431\u0443\u0434\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0442\u0430\u043a\u0438\u0445 \u0447\u0430\u0441\u0442\u0435\u0439 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043a\u0430\u043a \u043c\u043e\u0434\u0430\u043b\u044c\u043d\u043e\u0435 \u043e\u043a\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u044f, \u043f\u043e\u0438\u0441\u043a \u043f\u043e \u0441\u0430\u0439\u0442\u0443, \u043a\u0430\u0440\u0431\u0438\u043b\u0434\u0435\u0440 (\u0447\u0430\u0441\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0441\u0430\u0439\u0442\u0430, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0430\u044f \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u043c\u0430\u0448\u0438\u043d\u0443 \u0441\u0432\u043e\u0435\u0439 \u043c\u0435\u0447\u0442\u044b \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u043d\u0435\u0435 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0443 \u0441\u0430\u0439\u0442\u0430 \u0438 \u0434\u0438\u043b\u0435\u0440\u0430\u043c \u043f\u0430\u0440\u0442\u043d\u0435\u0440\u0430\u043c) \u0438 \u0442.\u0434. \u041d\u0438\u0447\u0435\u0433\u043e \u0442\u0430\u043a\u043e\u0433\u043e, \u0447\u0442\u043e \u0431\u044b \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u043e \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u0440\u043e\u0443\u0442, \u043d\u043e \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043f\u0440\u0438\u0434\u0430\u0441\u0442 \u043d\u0430\u0448\u0435\u043c\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e \u043e\u0442\u0437\u044b\u0432\u0447\u0438\u0432\u043e\u0441\u0442\u0438 \u0438 \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 \u043f\u043e\u0441\u0435\u0442\u0438\u0442\u0435\u043b\u0435\u043c.<\/p>\n<p>  \u0412 \u043f\u0435\u0440\u0441\u043f\u0435\u043a\u0442\u0438\u0432\u0435 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442 \u0432 \u043e\u0434\u043d\u043e\u0441\u0442\u0440\u0430\u043d\u0438\u0447\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 AngularJS, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0441 \u0431\u044d\u043a\u0435\u043d\u0434\u043e\u043c Yii2 REST. \u041d\u043e \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442, \u044f \u043d\u0435 \u0445\u043e\u0447\u0443 \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0442\u043e\u0433\u0434\u0430 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u044e, \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044e, \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044e, \u043f\u0440\u0430\u0432\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u043e\u0432 \u0438 \u0442\u043e\u043c\u0443 \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0435 \u043a\u0430\u043a \u0432 Angular.js, \u0442\u0430\u043a \u0438 \u043d\u0430 \u0431\u044d\u043a\u0435\u043d\u0434\u0435.<\/p>\n<p>  \u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 RESTful API Yii \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0430\u043c \u0447\u0438\u0441\u0442\u044b\u0439 API, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u043e\u0431\u043c\u0435\u043d\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0441\u043e \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u043c AngularJS \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c, \u0438\u043b\u0438 \u0436\u0435, \u0441 \u043d\u0430\u0448\u0438\u043c \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043c.<\/p>\n<p>  \u0422\u0430\u043a \u043a\u0430\u043a \u043c\u044b \u0437\u0430\u0431\u043e\u0442\u0438\u043c\u0441\u044f \u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043e\u0431\u0435\u0438\u043c\u0438 \u043d\u043e\u0433\u0430\u043c\u0438 \u0438\u0434\u0442\u0438 \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u0443 REST. \u0425\u043e\u0440\u043e\u0448\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 RESTful \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043f\u043b\u044e\u0441\u043e\u043c, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0435\u0441\u043b\u0438 \u0442\u0430\u043c \u043f\u0440\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u0430 \u0445\u043e\u0440\u043e\u0448\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441 \u0433\u0438\u0431\u043a\u043e\u0439 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0435\u0439. \u0422\u0430\u043a\u0436\u0435, \u043c\u044b \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u043c \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0431\u044d\u043a\u0435\u043d\u0434 \u0438 \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 Amazon EC2 \u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e JSON \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u043b\u043e\u0441\u044b \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0430\u043d\u0438\u044f. \u0422\u0435\u043c \u0431\u043e\u043b\u0435\u0435, \u0447\u0442\u043e Amazon EC2 \u043e\u0431\u043b\u0430\u0434\u0430\u0435\u0442 \u0442\u0430\u043a\u043e\u0439 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c\u044e, \u043a\u0430\u043a \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0435\u043c\u0443 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0430\u0434\u0430\u043f\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043c\u043e\u0449\u043d\u043e\u0441\u0442\u0438 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u0440\u0430\u0444\u0438\u043a\u0430 \u0441\u0430\u0439\u0442\u0430. \u0410 \u0447\u0442\u043e \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430, \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0435\u0433\u043e \u043d\u0430 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 CDN Amazon S3, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0438\u043c\u0435\u0435\u0442 \u0441\u0430\u043c\u0443\u044e \u043d\u0438\u0437\u043a\u0443\u044e \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u0438 \u0431\u043e\u043b\u0435\u0435 \u0431\u044b\u0441\u0442\u0440\u0443\u044e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u043e\u0442\u0432\u0435\u0442\u0430. \u041e\u0431 \u044d\u0442\u043e\u043c \u044f \u0431\u0443\u0434\u0443 \u043f\u0438\u0441\u0430\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0432 \u0441\u0432\u043e\u0438\u0445 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0441\u0442\u0430\u0442\u044c\u044f\u0445.<\/p>\n<p>  Yii2 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0446\u0435\u043b\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0434\u043b\u044f \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u044f RESTful API. \u0421\u0435\u0439\u0447\u0430\u0441 \u044f \u043f\u0440\u043e\u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u044e \u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043d\u0430\u0431\u043e\u0440 RESTful <br \/>  API, \u0441 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0437\u0430\u0442\u0440\u0430\u0442\u0430\u043c\u0438 \u0443\u0441\u0438\u043b\u0438\u0439 \u043d\u0430 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043a\u043e\u0434\u0430.<\/p>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430, \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u0434\u043b\u044f API \u0432 \u043c\u043e\u0434\u0443\u043b\u0435 <code>Lease<\/code>, \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u043f\u043e \u043f\u0443\u0442\u0438 <code>modules\/lease\/controllers\/frontend<\/code> \u0444\u0430\u0439\u043b <code>ApiController.php<\/code> \u0438 \u0432 \u043d\u0435\u043c \u043f\u0440\u043e\u043f\u0438\u0448\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:  <\/p>\n<pre><code class=\"php\">&lt;?php namespace modules\\lease\\controllers\\frontend;  use yii\\rest\\ActiveController;  class ApiController extends ActiveController {     public $modelClass = 'modules\\lease\\models\\frontend\\Lease'; } <\/code><\/pre>\n<p>  \u041a\u043b\u0430\u0441\u0441 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u0442\u0441\u044f \u043e\u0442 <a href=\"http:\/\/www.yiiframework.com\/doc-2.0\/yii-rest-activecontroller.html\">yii\\rest\\ActiveController<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u043e\u0431\u0449\u0438\u0439 \u043d\u0430\u0431\u043e\u0440 RESTful \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439. \u0423\u043a\u0430\u0437\u0430\u0432 <code>modelClass<\/code>, \u043a\u0430\u043a <code>modules\\lease\\models\\frontend\\Lease<\/code>, \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u0437\u043d\u0430\u0435\u0442, \u043a\u0430\u043a\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0430 \u0434\u043b\u044f \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u044f \u0438 \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u043c\u0438.<\/p>\n<p>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430\u0448\u0438\u043c API \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c ajax-\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0441 \u0434\u0440\u0443\u0433\u0438\u0445 \u0434\u043e\u043c\u0435\u043d\u043e\u0432, \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 <code>cors<\/code> \u0432 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440, \u0435\u0441\u043b\u0438 \u044d\u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e:  <\/p>\n<pre><code class=\"php\">...  public function behaviors()     {         $behaviors = parent::behaviors();         $behaviors['corsFilter' ] = [               'class' =&gt; \\yii\\filters\\Cors::className(),         ];         \/\/ \u0412 \u044d\u0442\u043e \u043c\u0435\u0441\u0442\u043e \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f (\u0447\u0438\u0442\u0430\u0439 \u043d\u0438\u0436\u0435)         return $behaviors;     } ...<\/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 \u0445\u043e\u0442\u0438\u043c \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0438\u0437 <a href=\"http:\/\/www.yiiframework.com\/doc-2.0\/yii-rest-controller.html\">yii\\rest\\Controller<\/a>, \u0432\u043e\u0442 \u043f\u043e\u0447\u0435\u043c\u0443 \u043c\u044b \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0435\u0433\u043e \u0432 \u043f\u0435\u0440\u0432\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 <code>$behaviors = parent::behaviors();<\/code> \u0438 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043a \u043d\u0435\u043c\u0443 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f.<\/p>\n<p>  Yii2 REST API-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0441\u043f\u043e\u0441\u043e\u0431\u0435\u043d \u043e\u0442\u0434\u0430\u0432\u0430\u0442\u044c \u043e\u0442\u0432\u0435\u0442\u044b \u0432 XML \u0438 JSON \u0444\u043e\u0440\u043c\u0430\u0442\u0430\u0445. \u041c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0444\u043e\u0440\u043c\u0430\u0442 JSON, \u2014 \u0441\u043e\u043e\u0431\u0449\u0438\u043c \u043e\u0431 \u044d\u0442\u043e\u043c \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0443:  <\/p>\n<pre><code class=\"php\">...  $behaviors['contentNegotiator'] = [     'class' =&gt; \\yii\\filters\\ContentNegotiator::className(),     'formats' =&gt; [         'application\/json' =&gt; \\yii\\web\\Response::FORMAT_JSON,     ], ]; ...<\/code><\/pre>\n<p>  \u041c\u044b \u0442\u0430\u043a\u0436\u0435 \u043b\u0435\u0433\u043a\u043e \u043c\u043e\u0436\u0435\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u043f\u0440\u0430\u0432\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u043e\u0432 \u043a \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f\u043c \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 API c \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043b\u0430\u0441\u0441\u0430 <a href=\"http:\/\/www.yiiframework.com\/doc-2.0\/yii-filters-accesscontrol.html\">yii\\filtersAccessControl<\/a>. \u0423\u043a\u0430\u0436\u0435\u043c, \u0447\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c, \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u0443\u0434\u0430\u043b\u044f\u0442\u044c \u043b\u0438\u0441\u0442\u0438\u043d\u0433\u0438 \u043c\u043e\u0433\u0443\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438:  <\/p>\n<pre><code class=\"php\">...  $behaviors['access'] = [     'class' =&gt; \\yii\\filters\\AccessControl::className(),     'only' =&gt; ['create', 'update', 'delete'],     'rules' =&gt; [         [             'actions' =&gt; ['create', 'update', 'delete'],             'allow' =&gt; true,             'roles' =&gt; ['@'],         ],     ], ]; ...<\/code><\/pre>\n<p>  \u0422\u0430\u043a\u0436\u0435, \u0434\u043b\u044f \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f\u043c \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043c\u0435\u0442\u043e\u0434 <code>CheckAccess()<\/code>, \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0438\u043c\u0435\u0435\u0442 \u043b\u0438 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043f\u0440\u0438\u0432\u0438\u043b\u0435\u0433\u0438\u044e \u043d\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043d\u0430\u0434 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u044c\u044e \u0434\u0430\u043d\u043d\u044b\u0445. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043c\u043e\u0433 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u043b\u0438 \u0443\u0434\u0430\u043b\u044f\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0432\u043e\u0438 \u043b\u0438\u0441\u0442\u0438\u043d\u0433\u0438:  <\/p>\n<pre><code class=\"php\">\u2026 public function checkAccess($action, $model = null, $params = []) {     \/\/ \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u043c\u043e\u0436\u0435\u0442 \u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u043b\u0438 \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0437\u0430\u043f\u0438\u0441\u044c     \/\/ \u0432\u044b\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u043c \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 ForbiddenHttpException \u0435\u0441\u043b\u0438 \u0434\u043e\u0441\u0442\u0443\u043f \u0437\u0430\u043f\u0440\u0435\u0449\u0435\u043d     if ($action === 'update' || $action === 'delete') {         if ($model-&gt;user_id !== \\Yii::$app-&gt;user-&gt;id)             throw new \\yii\\web\\ForbiddenHttpException(sprintf('You can only %s lease that you\\'ve created.', $action));     } } ...<\/code><\/pre>\n<p>  \u042d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0434\u043b\u044f \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u043a\u043b\u0430\u0441\u0441\u0430 <a href=\"http:\/\/www.yiiframework.com\/doc-2.0\/yii-rest-activecontroller.html\">yii\\rest\\ActiveController<\/a>. \u0415\u0441\u043b\u0438 \u0432\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0435 \u0432 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0435 \u043d\u043e\u0432\u043e\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0442\u0430\u043a\u0436\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u0434\u043e\u0441\u0442\u0443\u043f\u0430, \u0432\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u044f\u0432\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0432 \u043d\u043e\u0432\u044b\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f\u0445.<\/p>\n<p>  \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u044d\u0442\u0430\u043f\u043e\u043c \u043c\u044b \u0438\u0437\u043c\u0435\u043d\u0438\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 <code>urlManager<\/code> \u0432 \u0431\u0443\u0442\u0441\u0442\u0440\u044d\u043f\u043f\u0438\u043d\u0433 \u043a\u043b\u0430\u0441\u0441\u0435 \u043c\u043e\u0434\u0443\u043b\u044f \u0432 \u0444\u0430\u0439\u043b\u0435 <code>modules\/lease\/Bootstrap.php<\/code>  <\/p>\n<pre><code class=\"php\">... $app-&gt;getUrlManager()-&gt;addRules(    [        [            'class' =&gt; 'yii\\rest\\UrlRule',            'controller' =&gt; ['leases' =&gt; 'lease\/api'],            'prefix' =&gt; 'api'        ]    ] ); \u2026<\/code><\/pre>\n<p>  \u041f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u0430\u044f \u0432\u044b\u0448\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 URL \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0434\u043b\u044f \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 API \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0438 \u0438\u043c\u0438 \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043a\u043e\u0440\u043e\u0442\u043a\u043e\u0433\u043e URL-\u0430\u0434\u0440\u0435\u0441\u0430 \u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e HTTP \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430. \u041c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 <code>prefix<\/code>, \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0432\u0441\u0435 \u0441\u0441\u044b\u043b\u043a\u0438 \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043a API \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c \u043d\u0430\u0447\u0438\u043d\u0430\u043b\u0438\u0441\u044c \u0441 <code>\/api\/*<\/code>, \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043f\u043e \u044d\u0442\u043e\u043c\u0443 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0443 \u044d\u0442\u043e\u0442 \u043a\u043e\u043d\u0442\u0435\u043d\u0442 \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u0442\u043e \u0441\u043a\u0440\u044b\u0442\u044c \u043e\u0442 \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u044b\u0445 \u043c\u0430\u0448\u0438\u043d \u0432 \u0444\u0430\u0439\u043b\u0435 robots.txt. \u0412 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c, \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u043c\u043e\u0434\u0443\u043b\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0443\u0447\u0430\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0432 RESTful API-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0435, \u043c\u044b \u0442\u0430\u043a\u0438\u043c \u0436\u0435 \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0431\u0443\u0434\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u0434\u043b\u044f API.<\/p>\n<p>  \u041d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u043c \u0432\u044b\u0448\u0435 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u043a\u043e\u0434\u0430, \u043c\u044b \u0443\u0436\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043b\u0438 \u0441\u0432\u043e\u044e \u0437\u0430\u0434\u0430\u0447\u0443 \u043f\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e RESTful API-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0434\u0430\u043d\u043d\u044b\u043c \u0438\u0437 \u043c\u043e\u0434\u0435\u043b\u0438 <code>Lease<\/code>. \u041c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 API-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0442 \u0432 \u0441\u0435\u0431\u044f:   <\/p>\n<ul>\n<li>GET \/api\/leases: \u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0432\u0441\u0435 \u043b\u0438\u0441\u0442\u0438\u043d\u0433\u0438<\/li>\n<li>HEAD \/api\/leases: \u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u043e\u0442\u0432\u0435\u0442\u0430 \u043d\u0430 \u0437\u0430\u043f\u0440\u043e\u0441 GET \/api\/leases<\/li>\n<li>POST \/api\/leases: \u0421\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u043b\u0438\u0441\u0442\u0438\u043d\u0433<\/li>\n<li>GET \/api\/leases\/3: \u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043b\u0438\u0441\u0442\u0438\u043d\u0433\u0430 \u0441 id=3<\/li>\n<li>HEAD \/api\/leases\/3: \u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u043e\u0442\u0432\u0435\u0442\u0430 GET \/api\/leases\/3<\/li>\n<li>PATCH \/api\/leases\/3 \u0438 PUT \/api\/leases\/3: \u0418\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043b\u0438\u0441\u0442\u0438\u043d\u0433\u0430 \u0441 id=3<\/li>\n<li>DELETE \/api\/leases\/3: \u0423\u0434\u0430\u043b\u0438\u0442\u044c \u043b\u0438\u0441\u0442\u0438\u043d\u0433 id=3<\/li>\n<li>OPTIONS \/api\/leases: \u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0434\u043b\u044f \/api\/leases<\/li>\n<li>OPTIONS \/api\/leases\/3: \u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0434\u043b\u044f \/api\/leases\/3<\/li>\n<\/ul>\n<p>  \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430 RESTful API \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 Yii2, \u043c\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b\u0438 API \u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442\u044b \u0432 \u0432\u0438\u0434\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u044d\u0442\u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0434\u043b\u044f \u043e\u0434\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 (\u0434\u043b\u044f \u043e\u0434\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438).<\/p>\n<p>  \u041d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442, \u043c\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b\u0438 \u0447\u0430\u0441\u0442\u044c \u0431\u044d\u043a\u0435\u043d\u0434\u0430 \u0434\u043b\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u0442\u044c \u043a \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434\u0430 \u2013 \u043d\u0430\u0447\u043d\u0435\u043c \u0441 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043c AngularJS. \u0414\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f composer, \u043d\u0430\u043c \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u0432 \u0441\u0435\u043a\u0446\u0438\u044e <code>\u201crequire\u201d<\/code> \u0432 \u0444\u0430\u0439\u043b\u0435 <code>composer.json<\/code>.  <\/p>\n<pre><code>... &quot;bower-asset\/angular&quot;: &quot;^1.5&quot;, &quot;bower-asset\/angular-animate&quot;: &quot;^1.5&quot;, &quot;bower-asset\/angular-bootstrap&quot;: &quot;^2.2&quot; \u2026<\/code><\/pre>\n<p>  \u0418 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 <code>php composer.phar update<\/code>.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u0434\u0435\u043b\u0430\u0435\u043c <code>AssetBundle<\/code> \u0432 \u0444\u0430\u0439\u043b\u0435 \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043c\u044b \u043c\u043e\u0433\u043b\u0438 \u0441 \u043b\u0435\u0433\u043a\u043e\u0441\u0442\u044c\u044e \u043f\u043e\u0434\u0446\u0435\u043f\u0438\u0442\u044c AngularJS \u0444\u0430\u0439\u043b\u044b \u043a \u043b\u0435\u0439\u0430\u0443\u0442\u0443. \u0412\u043e\u0442 \u0442\u0430\u043a \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0444\u0430\u0439\u043b <code>\\frontend\\assets\\AngularAsset.php<\/code>  <\/p>\n<pre><code class=\"php\">&lt;?php namespace frontend\\assets;  use yii\\web\\AssetBundle; use yii\\web\\View;  class AngularAsset extends AssetBundle {     public $sourcePath = '@bower';     public $js = [         'angular\/angular.js',         'angular-animate\/angular-animate.min.js',         'angular-bootstrap\/ui-bootstrap.min.js',         'angular-bootstrap\/ui-bootstrap-tpls.min.js'     ];      public $jsOptions = [         'position' =&gt; View::POS_HEAD,     ]; }<\/code><\/pre>\n<p>  <code>public $jsOptions = [ \u2018position\u2019 =&gt; View::POS_HEAD, ];<\/code> \u0441\u043e\u043e\u0431\u0449\u0430\u0435\u0442 Yii, \u0447\u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c JavaScript \u0444\u0430\u0439\u043b\u044b \u0432 \u0441\u0435\u043a\u0446\u0438\u0438 head \u043d\u0430\u0448\u0435\u0433\u043e \u043b\u0435\u0439\u0430\u0443\u0442\u0430 \u0432\u043c\u0435\u0441\u0442\u043e \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u0442\u044c \u0438\u0445 \u0432 \u0441\u0430\u043c\u043e\u043c \u043a\u043e\u043d\u0446\u0435 \u0441\u0435\u043a\u0446\u0438\u0438 body, \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u044f\u0434\u0440\u043e AngularJS \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u0441\u044f \u043d\u0430\u0441\u0442\u043e\u043b\u044c\u043a\u043e \u0431\u044b\u0441\u0442\u0440\u043e, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044d\u0442\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e. \u041c\u044b \u0442\u0430\u043a\u0436\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u044d\u0442\u043e\u0442 Bundle \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0433\u043b\u0430\u0432\u043d\u043e\u0433\u043e <code>asset bundle<\/code> \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u0442\u0430\u043c \u0436\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u0444\u0430\u0439\u043b <code>\u2018js\/app.js\u2019<\/code>, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 AngularJS \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.  <\/p>\n<pre><code class=\"php\">&lt;?php  namespace frontend\\assets;  use yii\\web\\AssetBundle;  \/**  * Main frontend application asset bundle.  *\/ class AppAsset extends AssetBundle {     public $basePath = '@webroot';     public $baseUrl = '@web';     public $css = [         'css\/site.css',     ];     public $js = [         'js\/app.js',         'js\/controllers.js',         'js\/directives.js',         'js\/services.js',     ];     public $depends = [         'yii\\web\\YiiAsset',         'yii\\bootstrap\\BootstrapAsset',         'frontend\\assets\\AngularAsset'     ]; }<\/code><\/pre>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0437\u0430\u043e\u0434\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0444\u0430\u0439\u043b <code>controllers.js<\/code> \u0432 \u044d\u0442\u043e\u0442 \u0436\u0435 \u0431\u0430\u043d\u0434\u043b. \u0412 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c, \u043c\u044b \u043f\u0440\u043e\u043f\u0438\u0448\u0435\u043c \u0432 \u043d\u0435\u043c \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u044b \u043d\u0430\u0448\u0435\u0433\u043e \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434\u0430, <code>directives.js<\/code> \u0438 <code>services.js<\/code> \u0434\u043b\u044f \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432 \u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e.<\/p>\n<p>  \u041d\u0430\u0447\u043d\u0435\u043c \u0438\u043c\u043f\u043b\u0435\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c Angular \u0432\u043e \u0432\u044c\u044e\u0445\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u044b <code>ng-app<\/code> \u043a \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0443 html \u2013 \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043d\u0430\u0448\u0435 AngularJS \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u044b \u043d\u0430\u0437\u043e\u0432\u0435\u043c <code>\u201capp\u201d<\/code>.  <\/p>\n<pre><code class=\"xml\">... &lt;html lang=&quot;&lt;?= Yii::$app-&gt;language ?&gt;&quot; data-ng-app=&quot;app&quot; &gt; ...<\/code><\/pre>\n<p>  \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u0443 <code>data-ng-app<\/code> \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a, \u0438\u043d\u0430\u0447\u0435, \u043d\u0430\u0448\u0430 html \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0430 \u043d\u0435 \u043f\u0440\u043e\u0439\u0434\u0435\u0442 W3C \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044e. \u041d\u0430 \u0440\u0430\u0431\u043e\u0442\u0443 \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432 \u044d\u0442\u043e \u043d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u0432\u043b\u0438\u044f\u043d\u0438\u044f \u043d\u0435 \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u0430 \u0432\u0435\u0440\u0441\u0442\u043a\u0430 \u0443 \u043d\u0430\u0441 \u0434\u043e\u043b\u0436\u043d\u0430 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442\u044c \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044e \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043f\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0443. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043d\u0435\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0434\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u0441\u0442\u0430\u0432\u043a\u0443 <code>data-<\/code>.<br \/>  \u041a\u043e\u0434 \u0434\u043b\u044f Angular \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u0442\u044c\u0441\u044f \u0432 <code>frontend\/web\/js\/app.js<\/code>. \u0422\u0430\u043c \u043c\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043c \u043a \u043d\u0435\u043c\u0443 \u043c\u043e\u0434\u0443\u043b\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c.  <\/p>\n<pre><code class=\"javascript\">'use strict';  var app = angular.module('app', [     'ngAnimate',     'ui.bootstrap',     'controllers'       \/\/\u043d\u0430\u0448 \u043c\u043e\u0434\u0443\u043b\u044c frontend\/web\/js\/controllers.js ]);<\/code><\/pre>\n<p>  \u0412 \u0444\u0430\u0439\u043b\u0435 <code>frontend\/web\/js\/services.js<\/code> \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u0441\u0435\u0440\u0432\u0438\u0441 <code>LeaseService<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c CRUD \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u043b\u0438\u0441\u0442\u0438\u043d\u0433\u043e\u0432 \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c \u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0441 REST API \u0431\u044d\u043a\u0435\u043d\u0434\u0430:   <\/p>\n<pre><code class=\"javascript\">'use strict';  var app = angular.module('app');  app.service('LeaseService', function($http) {     this.get = function() {         return $http.get('\/api\/leases');     };     this.post = function (data) {         return $http.post('\/api\/leases', data);     };     this.put = function (id, data) {         return $http.put('\/api\/leases\/' + id, data);     };     this.delete = function (id) {         return $http.delete('\/api\/leases\/' + id);     }; });<\/code><\/pre>\n<p>  \u041d\u0430 \u0441\u0435\u0433\u043e\u0434\u043d\u044f\u0448\u043d\u0438\u0439 \u0434\u0435\u043d\u044c, \u043d\u0430\u0448 \u043c\u043e\u0434\u0443\u043b\u044c <code>controllers<\/code> \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0432 \u0441\u0435\u0431\u0435 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 <code>LeaseController<\/code>. \u041e\u043d \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u0442 <code>\/api\/leases<\/code> \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435.  <\/p>\n<pre><code class=\"javascript\">'use strict';  var controllers = angular.module('controllers', []);  controllers.controller('LeaseController', ['$scope', 'LeaseService',     function ($scope, LeaseService) {         $scope.leases = [];         LeaseService.get().then(function (data) {             if (data.status == 200)                 $scope.leases = data.data;         }, function (err) {             console.log(err);         })     } ]);<\/code><\/pre>\n<p>  \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u044d\u0442\u043e\u0442 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u0432 \u0444\u0430\u0439\u043b\u0435 <code>\\modules\\lease\\views\\frontend\\default\\index.php<\/code> \u0443\u043a\u0430\u0437\u0430\u0432 \u0447\u0435\u0440\u0435\u0437 \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u0443 <code>ng-controller<\/code> \u0438 \u0432\u044b\u0432\u043e\u0434\u0438\u043c \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0434\u0430\u043d\u043d\u044b\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u043c \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u043b API:  <\/p>\n<pre><code class=\"xml\">&lt;div class=&quot;lease-default-index&quot; data-ng-controller=&quot;LeaseController&quot;&gt;     &lt;div&gt;         &lt;h1&gt;All Leases&lt;\/h1&gt;         &lt;div data-ng-show=&quot;leases.length &gt; 0&quot;&gt;             &lt;table class=&quot;table table-striped table-hover&quot;&gt;                 &lt;thead&gt;                     &lt;th&gt;Year&lt;\/th&gt;                     &lt;th&gt;Make&lt;\/th&gt;                     &lt;th&gt;Model&lt;\/th&gt;                     &lt;th&gt;Trim&lt;\/th&gt;                 &lt;\/thead&gt;                 &lt;tbody&gt;                 &lt;tr data-ng-repeat=&quot;lease in leases&quot;&gt;                     &lt;td&gt;{{lease.year}}&lt;\/td&gt;                     &lt;td&gt;{{lease.make}}&lt;\/td&gt;                     &lt;td&gt;{{lease.model}}&lt;\/td&gt;                     &lt;td&gt;{{lease.trim}}&lt;\/td&gt;                 &lt;\/tr&gt;                 &lt;\/tbody&gt;             &lt;\/table&gt;         &lt;\/div&gt;         &lt;div data-ng-show=&quot;leases.length == 0&quot;&gt;             No results         &lt;\/div&gt;     &lt;\/div&gt; &lt;\/div&gt;<\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u043f\u043e \u043f\u0443\u0442\u0438 <code>\/lease\/default\/index<\/code>, \u043c\u044b \u0443\u0432\u0438\u0434\u0438\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u0432\u0441\u0435\u0445 \u043b\u0438\u0441\u0442\u0438\u043d\u0433\u043e\u0432, \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u0432 \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445. <\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/e47\/747\/290\/e4774729098c446393de250f99255df6.png\"\/><\/p>\n<p>  \u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u0432\u044b \u0443\u0431\u0435\u0434\u0438\u043b\u0438\u0441\u044c, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0431\u044b\u0441\u0442\u0440\u043e \u0438 \u043b\u0435\u0433\u043a\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c RESTful API-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043d\u0430 \u0431\u0430\u0437\u0435 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 Yii2. \u0412\u0435\u0441\u044c \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u0432 \u044d\u0442\u043e\u0439 \u0438 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u0441\u0442\u0430\u0442\u044c\u044f\u0445 \u043a\u043e\u0434, \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0434\u043b\u044f \u0432\u0430\u0441 \u0432 <a href=\"https:\/\/github.com\/pavelsingree\/yii2-angular\">\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438<\/a>.<\/p>\n<p>  \u041c\u0430\u0442\u0435\u0440\u0438\u0430\u043b \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u043b\u0438: <a href=\"https:\/\/habrahabr.ru\/users\/greebn9k\/\" class=\"user_link\">greebn9k<\/a>(\u0421\u0435\u0440\u0433\u0435\u0439 \u0413\u0440\u0438\u0431\u043d\u044f\u043a), <a href=\"https:\/\/habrahabr.ru\/users\/pavel-berezhnoy\/\" class=\"user_link\">pavel-berezhnoy<\/a>(\u041f\u0430\u0432\u0435\u043b \u0411\u0435\u0440\u0435\u0436\u043d\u043e\u0439)<br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habrahabr.ru\/post\/318242\/\"> https:\/\/habrahabr.ru\/post\/318242\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/f68\/9ed\/aef\/f689edaef537484ea81d4eccb80fcc6d.png\"\/><br \/>  \u0417\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u0439\u0442\u0435, \u0434\u043e\u0440\u043e\u0433\u0438\u0435 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u0438!<\/p>\n<p>  \u0421\u0443\u0434\u044f \u043f\u043e \u0432\u0430\u0448\u0438\u043c \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u043c \u043a <a href=\"https:\/\/habrahabr.ru\/post\/308948\/\">\u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u043c \u0441\u0442\u0430\u0442\u044c\u044f\u043c<\/a>, \u043c\u043d\u043e\u0433\u0438\u043c \u0438\u0437 \u0432\u0430\u0441 \u043e\u0447\u0435\u043d\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u043a\u0430\u043a \u0438\u043c\u0435\u043d\u043d\u043e \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c AngularJS \u0432 \u0441\u0432\u044f\u0437\u043a\u0435 \u0441 \u043d\u0430\u0448\u0438\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 Yii2 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0435. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043f\u043e\u0434\u043d\u0438\u043c\u0443 \u0437\u0430\u043d\u0430\u0432\u0435\u0441 \u0438 \u043e\u043f\u0438\u0448\u0443 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 AngularJS \u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u0435\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f.<\/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-282937","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/282937","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=282937"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/282937\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=282937"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=282937"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=282937"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}