{"id":256181,"date":"2015-04-28T11:57:02","date_gmt":"2015-04-28T07:57:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=256181"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=256181","title":{"rendered":"Native Script. \u041e\u0434\u0438\u043d \u043a\u043e\u0434 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c"},"content":{"rendered":"<p> \t\t\t<img decoding=\"async\" src=\"http:\/\/habrastorage.org\/files\/c51\/541\/e1f\/c51541e1f1194eccbfc707fe43464d7a.jpg\" alt=\"image\"\/><\/p>\n<p>  Native script (NS) \u2013 \u044d\u0442\u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0430\u044f \u0434\u0435\u043b\u0430\u0442\u044c \u043a\u0440\u043e\u0441\u0441-\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u044b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f XML, CSS, JavaScript. Native script \u0440\u0435\u0448\u0430\u0435\u0442 \u0442\u0443 \u0436\u0435 \u0437\u0430\u0434\u0430\u0447\u0443, \u0447\u0442\u043e \u0438 \u0443\u0436\u0435 \u0432\u0441\u0435\u043c \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0439 phonegap (\u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043a\u0440\u043e\u0441\u0441-\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439), \u043d\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u044b \u0443 \u043d\u0438\u0445 \u0440\u0430\u0437\u043d\u044b\u0435. Phonegap \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0434\u0432\u0438\u0436\u043e\u043a \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430, \u0447\u0442\u043e\u0431\u044b \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u0432\u0430\u0448 UI (\u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0435 \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443), Native script \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043d\u0430\u0442\u0438\u0432\u043d\u043e\u0433\u043e UI. \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u0432\u0430\u0436\u043d\u043e\u0435 \u043e\u0442\u043b\u0438\u0447\u0438\u0435: \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043a\u0430\u043c\u0435\u0440\u0435, gps \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435 \u0432 phonegap \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u043f\u043b\u0430\u0433\u0438\u043d\u044b, \u0432 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a NS \u0434\u0430\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438.<a name=\"habracut\"><\/a><br \/>  \u0421\u0442\u043e\u0438\u0442 \u043f\u043e\u0434\u0447\u0435\u0440\u043a\u043d\u0443\u0442\u044c, \u0447\u0442\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u043f\u0438\u0441\u0430\u0442\u044c \u0434\u043b\u044f Android 4.2 \u0438 \u0432\u044b\u0448\u0435, \u0438 \u0434\u043b\u044f iOS 7.1 \u0438 \u0432\u044b\u0448\u0435.<\/p>\n<h4><b>\u0411\u044b\u0441\u0442\u0440\u044b\u0439 \u0441\u0442\u0430\u0440\u0442<\/b><\/h4>\n<p>  \u0427\u0442\u043e\u0431\u044b \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c native script, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c nodejs, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0449\u0435 \u043d\u0435\u0442 \u0435\u0433\u043e, \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0439\u0442\u0435\u0441\u044c <a href=\"https:\/\/nodejs.org\/\">\u0441\u044e\u0434\u0430<\/a>. \u0414\u0430\u043b\u044c\u0448\u0435 \u0432\u0441\u0435 \u043f\u0440\u043e\u0441\u0442\u043e. \u0414\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 NS \u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c:<\/p>\n<pre><code class=\"bash\">npm install -g nativescript <\/code><\/pre>\n<p>  \u0414\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430:<\/p>\n<pre><code class=\"bash\">tns create MyApp <\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043f\u0440\u043e\u0435\u043a\u0442 \u0441\u043e\u0437\u0434\u0430\u043b\u0441\u044f, \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u043f\u0440\u043e\u0435\u043a\u0442\u0430:<\/p>\n<pre><code class=\"bash\">cd MyApp <\/code><\/pre>\n<p>  \u0418, \u043a\u0430\u043a \u0438 \u0432 phonegap, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b:<\/p>\n<pre><code class=\"bash\">tns run android tns run ios <\/code><\/pre>\n<p>  \u0412\u0441\u0435 \u0433\u043e\u0442\u043e\u0432\u043e, \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043d\u0430\u0448\u0435 \u043f\u0435\u0440\u0432\u043e\u0435 native script \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e, \u043d\u0443\u0436\u043d\u043e \u0432\u0435\u0441\u0442\u0438 \u043e\u0434\u043d\u0443 \u0438\u0437 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u043a\u043e\u043c\u0430\u043d\u0434:<\/p>\n<p>  \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043d\u0430 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0435, \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u043e\u043c \u0447\u0435\u0440\u0435\u0437 USB:<\/p>\n<pre><code class=\"bash\">tns run android  <\/code><\/pre>\n<p>  \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0432 \u044d\u043c\u0443\u043b\u044f\u0442\u043e\u0440\u0435:<\/p>\n<pre><code class=\"bash\">tns run android --emulator <\/code><\/pre>\n<p>  \u041c\u043e\u0436\u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0432 Genymotion:<\/p>\n<pre><code class=\"bash\">tns run android --geny &lt;device name&gt; <\/code><\/pre>\n<p>  \u0412 \u043e\u0431\u0449\u0435\u043c, \u043a\u0430\u043a \u0431\u044b \u0432\u044b \u043d\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u043b\u0438, \u0443 \u0432\u0430\u0441 \u043e\u0442\u043a\u0440\u043e\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u043e\u0434\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043d\u0430\u0436\u0430\u0442\u0438\u0439 \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0443, \u043e\u0441\u0442\u0430\u0432\u0448\u0438\u0445\u0441\u044f \u0434\u043e \u0432\u044b\u0432\u043e\u0434\u0430 \u0442\u0435\u043a\u0441\u0442\u0430 \u00abHoorraaay! You unlocked the NativeScript clicker achievement!\u00bb. <\/p>\n<p>  <img decoding=\"async\" src=\"\/\/habrastorage.org\/files\/7a9\/44d\/6ff\/7a944d6ff0c349778b124ef7696ea5fe.png\"\/><\/p>\n<p>  \u0412\u043e\u0442 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u043a\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 iOS \u0438 Android. <\/p>\n<p>  <img decoding=\"async\" src=\"\/\/habrastorage.org\/files\/4b0\/18d\/dce\/4b018ddcebaa4e70a93e80da1c4d4de8.png\"\/><\/p>\n<p>  \u041a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u043a\u043d\u043e\u043f\u043a\u0430 \u0432\u0435\u0437\u0434\u0435 \u043d\u0430\u0442\u0438\u0432\u043d\u0430\u044f, \u0445\u043e\u0442\u044f \u043a\u043e\u0434 \u0434\u043b\u044f \u043e\u0431\u043e\u0438\u0445 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435.<\/p>\n<h4><b>\u0427\u0442\u043e \u0442\u0430\u043c \u0432\u043d\u0443\u0442\u0440\u0438?<\/b><\/h4>\n<p>  \u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0430 \u043d\u0438\u0436\u0435:<\/p>\n<p>  <img decoding=\"async\" src=\"\/\/habrastorage.org\/files\/c1f\/383\/fa2\/c1f383fa26954836b74b3d868c38368e.png\"\/><\/p>\n<p>  \u0412\u0441\u0435, \u0447\u0442\u043e \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f \u0432\u0438\u0434\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043b\u0435\u0436\u0438\u0442 \u0432 \u0444\u0430\u0439\u043b\u0435 <i>main-page.xml<\/i>. \u0412\u0441\u0435\u0445, \u043a\u0442\u043e \u043f\u0440\u0438\u0432\u044b\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 html, \u0443\u0436\u0430\u0441\u043d\u0435\u0442 \u044d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b, \u043d\u043e \u0431\u043b\u0430\u0433\u043e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u043e\u0447\u0435\u043d\u044c \u0445\u043e\u0440\u043e\u0448\u0430\u044f, \u0438 \u0447\u0443\u0442\u044c \u043f\u043e\u0437\u0436\u0435 \u0432\u0441\u0435 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043f\u043e\u043d\u044f\u0442\u043d\u0435\u0435.<\/p>\n<pre><code class=\"xml\">&lt;Page xmlns=&quot;http:\/\/www.nativescript.org\/tns.xsd&quot; loaded=&quot;pageLoaded&quot;&gt;   &lt;StackLayout&gt;     &lt;Label text=&quot;Tap the button&quot; cssClass=&quot;title&quot;\/&gt;     &lt;Button text=&quot;TAP&quot; tap=&quot;{{ tapAction }}&quot; \/&gt;     &lt;Label text=&quot;{{ message }}&quot; cssClass=&quot;message&quot; textWrap=&quot;true&quot;\/&gt;   &lt;\/StackLayout&gt; &lt;\/Page&gt; <\/code><\/pre>\n<p>  <i>app.js<\/i> \u2013 \u0442\u043e\u0447\u043a\u0430 \u0432\u0445\u043e\u0434\u0430 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u0412 NS \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u043c\u043e\u0434\u0443\u043b\u0438, \u0442\u0430\u043a \u0436\u0435 \u043a\u0430\u043a \u0438 nodejs. \u0414\u0443\u043c\u0430\u044e, \u0442\u0443\u0442 \u0432\u0441\u0435 \u0438\u0442\u0430\u043a \u043f\u043e\u043d\u044f\u0442\u043d\u043e. <\/p>\n<pre><code class=\"javascript\">var application = require(&quot;application&quot;); application.mainModule = &quot;main-page&quot;; application.cssFile = &quot;.\/app.css&quot;; application.start(); <\/code><\/pre>\n<p>  <i>main-page.js <\/i>\u2013 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043a\u043e\u0434 \u0434\u043b\u044f main-page.xml.<\/p>\n<pre><code class=\"javascript\">var vmModule = require(&quot;.\/main-view-model&quot;); function pageLoaded(args) {     var page = args.object;     page.bindingContext = vmModule.mainViewModel; } exports.pageLoaded = pageLoaded; <\/code><\/pre>\n<p>  \u0424\u0443\u043d\u043a\u0446\u0438\u044f pageLoaded \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0430, \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b (\u0441\u043c. main-page.xml). \u0421\u0442\u0440\u043e\u043a\u0430 page.bindingContext = vmModule.mainViewModel \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 binding \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0434\u043b\u044f \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b (\u0447\u0442\u043e-\u0442\u043e \u043d\u0430\u043f\u043e\u0434\u043e\u0431\u0438\u0435 $scope \u0432 \u0430\u043d\u0433\u0443\u043b\u044f\u0440). \u041d\u0443 \u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f \u0441\u0442\u0440\u043e\u043a\u0430 \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044e. <\/p>\n<p>  \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0444\u0430\u0439\u043b, main-view-model.js, \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c data binding \u0432 NS. NS \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 two-way \u0438 one-way binding.<\/p>\n<pre><code class=\"javascript\">var __extends = this.__extends || function (d, b) {     for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];     function __() { this.constructor = d; }     __.prototype = b.prototype;     d.prototype = new __(); }; var observable = require(&quot;data\/observable&quot;); var HelloWorldModel = (function (_super) {     __extends(HelloWorldModel, _super);     function HelloWorldModel() {         _super.call(this);         this.counter = 42;         this.set(&quot;message&quot;, this.counter + &quot; taps left&quot;);     }     HelloWorldModel.prototype.tapAction = function () {         this.counter--;         if (this.counter &lt;= 0) {             this.set(&quot;message&quot;, &quot;Hoorraaay! You unlocked the NativeScript clicker achievement!&quot;);         }         else {             this.set(&quot;message&quot;, this.counter + &quot; taps left&quot;);         }     };     return HelloWorldModel; })(observable.Observable); exports.HelloWorldModel = HelloWorldModel; exports.mainViewModel = new HelloWorldModel(); <\/code><\/pre>\n<p>  \u0427\u0442\u043e\u0431\u044b dataBinding \u0440\u0430\u0431\u043e\u0442\u0430\u043b, \u0432 NS \u043e\u0431\u044a\u0435\u043a\u0442 \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u044b\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0442\u044c \u0441\u043e\u0431\u044b\u0442\u0438\u0435 propertyChange. \u042d\u0442\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043e \u0432 \u043a\u043b\u0430\u0441\u0441\u0435 Observable. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u043d \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 HelloWorldModel \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0435\u0433\u043e. \u0414\u0430\u043b\u044c\u0448\u0435 \u0443\u0436\u0435 \u0447\u0435\u0440\u0435\u0437 \u043c\u0435\u0442\u043e\u0434 set \u043f\u043e\u043b\u044f\u043c \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f. \u0424\u0443\u043d\u043a\u0446\u0438\u044f __extends \u0432 \u0441\u0430\u043c\u043e\u043c \u0432\u0435\u0440\u0445\u0443 \u0444\u0430\u0439\u043b\u0430 \u0441\u043b\u0443\u0436\u0438\u0442 \u0434\u043b\u044f \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f. <\/p>\n<p>  \u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u0434\u0432\u0443\u0445\u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0439 binding \u0432 \u0434\u0435\u043b\u0435. \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0432 main-page.xml \u0434\u0432\u0435 \u0441\u0442\u0440\u043e\u0447\u043a\u0438 \u043f\u0435\u0440\u0435\u0434 \u0442\u0435\u0433\u043e\u043c . <\/p>\n<pre><code class=\"xml\">&lt;TextField text=&quot;{{ name }}&quot; hint=&quot;\u0432\u0432\u0435\u0434\u0438\u0442\u0435 \u0432\u0430\u0448\u0435 \u0438\u043c\u044f&quot;\/&gt; &lt;Label cssClass=&quot;{{name, !!name ? 'title ' : 'title  hidden'}}&quot; text=&quot;{{ name, 'Hello ' + name }}&quot;\/&gt;   <\/code><\/pre>\n<p>  \u0412 \u0444\u0430\u0439\u043b\u0435 main-view-model.js \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e HelloWorldModel \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0441\u0442\u0440\u043e\u043a\u0443:<\/p>\n<pre><code class=\"java\">this.set(&quot;name&quot;, &quot;&quot;); <\/code><\/pre>\n<p>  \u0418 \u043d\u0430\u043a\u043e\u043d\u0435\u0446 \u0432 app.css. \u0421\u0442\u043e\u0438\u0442 \u043f\u043e\u0434\u0447\u0435\u0440\u043a\u043d\u0443\u0442\u044c, \u0447\u0442\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0434\u0430\u043b\u0435\u043a\u043e \u043d\u0435 \u0432\u0441\u0435 CSS \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430, \u043f\u043e\u043b\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 <a href=\"http:\/\/docs.nativescript.org\/styling.html\">\u0442\u0443\u0442<\/a>. <\/p>\n<pre><code class=\"css\">.hidden {     visibility: collapsed; } <\/code><\/pre>\n<p>  \u0412 \u0438\u0442\u043e\u0433\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043c:<\/p>\n<p>  <img decoding=\"async\" src=\"\/\/habrastorage.org\/files\/9db\/2bc\/f8a\/9db2bcf8a5274bfeb23bd15c591fd237.jpg\"\/><\/p>\n<h4><b>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/b><\/h4>\n<p>  Native script \u0434\u043b\u044f \u043c\u0435\u043d\u044f, \u043a\u0430\u043a \u0434\u043b\u044f \u0432\u0435\u0431-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430, \u043e\u0441\u0442\u0430\u0432\u0438\u043b \u0441\u043c\u0435\u0448\u0430\u043d\u043d\u044b\u0435 \u0447\u0443\u0432\u0441\u0442\u0432\u0430. \u0421 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b, \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0430\u0432\u0442\u043e\u0440\u044b \u0441\u0442\u0430\u0440\u0430\u043b\u0438\u0441\u044c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432\u0441\u0435 \u0431\u043b\u0438\u0437\u043a\u043e \u043a \u0432\u0435\u0431\u0443 (JavaScript, CSS), \u043d\u043e \u0441 \u0434\u0440\u0443\u0433\u043e\u0439, CSS \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u043d\u0435 \u0432\u0441\u0435, \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0441 XML \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u043b\u0435\u0437\u0442\u044c \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e NS \u0440\u0435\u0448\u0438\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0435\u0441\u0442\u044c \u0432 phonegap, \u0433\u0434\u0435 \u0442\u043e \u0442\u0443\u0442, \u0442\u043e \u0442\u0430\u043c \u043f\u043e\u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0441 \u0432\u0435\u0431 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0412 \u043b\u044e\u0431\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u044d\u0442\u043e \u043a\u0440\u0443\u0442\u043e, \u0447\u0442\u043e \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u043c \u0437\u043d\u0430\u044e\u0449\u0438\u043c JavaScript \u043f\u0438\u0441\u0430\u0442\u044c \u043a\u0440\u043e\u0441\u0441-\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u044b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0442.\u043a. \u043d\u0430 \u044d\u0442\u043e\u043c \u0440\u044b\u043d\u043a\u0435 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0442\u0435\u0441\u043d\u043e (phoneGap, Native Script, React Native) \u0438 \u043a\u0430\u043a \u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u0432 \u0434\u043e\u043b\u0436\u043d\u043e \u0443\u043b\u0443\u0447\u0448\u0430\u0442\u044c\u0441\u044f. \t\t\t<\/p>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/256817\/\"> http:\/\/habrahabr.ru\/post\/256817\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p> \t\t\t<img decoding=\"async\" src=\"http:\/\/habrastorage.org\/files\/c51\/541\/e1f\/c51541e1f1194eccbfc707fe43464d7a.jpg\" alt=\"image\"\/><\/p>\n<p>  Native script (NS) \u2013 \u044d\u0442\u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0430\u044f \u0434\u0435\u043b\u0430\u0442\u044c \u043a\u0440\u043e\u0441\u0441-\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u044b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f XML, CSS, JavaScript. Native script \u0440\u0435\u0448\u0430\u0435\u0442 \u0442\u0443 \u0436\u0435 \u0437\u0430\u0434\u0430\u0447\u0443, \u0447\u0442\u043e \u0438 \u0443\u0436\u0435 \u0432\u0441\u0435\u043c \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0439 phonegap (\u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043a\u0440\u043e\u0441\u0441-\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439), \u043d\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u044b \u0443 \u043d\u0438\u0445 \u0440\u0430\u0437\u043d\u044b\u0435. Phonegap \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0434\u0432\u0438\u0436\u043e\u043a \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430, \u0447\u0442\u043e\u0431\u044b \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u0432\u0430\u0448 UI (\u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0435 \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443), Native script \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043d\u0430\u0442\u0438\u0432\u043d\u043e\u0433\u043e UI. \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u0432\u0430\u0436\u043d\u043e\u0435 \u043e\u0442\u043b\u0438\u0447\u0438\u0435: \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043a\u0430\u043c\u0435\u0440\u0435, gps \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435 \u0432 phonegap \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u043f\u043b\u0430\u0433\u0438\u043d\u044b, \u0432 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a NS \u0434\u0430\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-256181","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/256181","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=256181"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/256181\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=256181"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=256181"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=256181"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}