Skip to content

Commit 92c5e9a

Browse files
committed
A couple other small wording tweaks to chapter 2
1 parent 58d276e commit 92c5e9a

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

images/chapter2/android/5.png

124 Bytes
Loading

images/chapter2/ios/5.png

-3.65 KB
Loading

index.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ <h4 class="exercise-start">
448448
<div class="exercise-end"></div>
449449

450450
<p>NativeScript supports CSS&#39;s <code>@import</code> statement for importing one CSS file into another. So this new line of code imports the CSS rules from <code>platform.css</code> into <code>app.css</code>. But, you might have noticed that Groceries does not have a file named <code>platform.css</code>—only <code>app/platform.android.css</code> and <code>app/platform.ios.css</code> exist. What&#39;s going on here?</p>
451-
<p><a id="platform-specific-files"></a>When you execute <code>tns run</code>, or <code>tns livesync</code>, the NativeScript CLI takes your code from the <code>app</code> folder and places it in the native projects located in the <code>platforms/ios</code> and <code>platforms/android</code> folders. Here the naming convention comes in: while moving files, the CLI intelligently selects <code>.android.*</code> and <code>.ios.*</code> files. To give a specific example, the CLI moves <code>platform.ios.css</code> into <code>platforms/ios</code> and renames it to <code>platform.css</code>; similarly, the CLI moves <code>platform.android.css</code> into <code>platforms/android</code>, and again renames it to <code>platform.css</code>. This convention provides a convenient way to branch your code to handle iOS and Android separately, and it&#39;s supported for any type of file in NativeScript—not just CSS files. You&#39;ll see a few more examples of this convention later in this guide.</p>
451+
<p><a id="platform-specific-files"></a>When you execute <code>tns run</code>, or <code>tns livesync</code>, the NativeScript CLI takes the code from your <code>app</code> folder and places it in the native projects located in the <code>platforms/ios</code> and <code>platforms/android</code> folders. Here the naming convention comes in: while moving files, the CLI intelligently selects <code>.android.*</code> and <code>.ios.*</code> files. To give a specific example, the CLI moves <code>platform.ios.css</code> into <code>platforms/ios</code> and renames it to <code>platform.css</code>; similarly, the CLI moves <code>platform.android.css</code> into <code>platforms/android</code>, and again renames it to <code>platform.css</code>. This convention provides a convenient way to branch your code to handle iOS and Android separately, and it&#39;s supported for any type of file in NativeScript—not just CSS files. You&#39;ll see a few more examples of this convention later in this guide.</p>
452452
<p>With these changes in place, you&#39;ll notice that the app has a bit more spacing, and also that the text fields have borders on iOS but that Android:</p>
453453
<p><img src="images/chapter2/ios/3.png" alt="login 3">
454454
<img src="images/chapter2/android/3.png" alt="login 3"></p>
@@ -459,7 +459,7 @@ <h4 class="exercise-start">
459459
<b>Exercise</b>: Add component-specific CSS
460460
</h4>
461461

462-
<p>Open your app’s <code>app/app.component.ts</code> file and add a <code>styleUrls</code> property such that that full <code>@Component</code> declaration now looks like this:</p>
462+
<p>Open your <code>app/app.component.ts</code> file and add a <code>styleUrls</code> property, so that that full <code>@Component</code> declaration now looks like this:</p>
463463
<pre><code class="lang-JavaScript">@Component({
464464
selector: &quot;my-app&quot;,
465465
template: `
@@ -507,7 +507,7 @@ <h4 class="exercise-start">
507507
<b>Exercise</b>: Add an <code>id</code> attribute
508508
</h4>
509509

510-
<p>Open your app’s <code>app/app.component.ts</code> file, find <code>&lt;Button text=&quot;Sign in&quot;&gt;&lt;/Button&gt;</code> in your component’s <code>template</code>, and replace it with the code below:</p>
510+
<p>Open your <code>app/app.component.ts</code> file, find <code>&lt;Button text=&quot;Sign in&quot;&gt;&lt;/Button&gt;</code> in your component’s <code>template</code>, and replace it with the code below:</p>
511511
<pre><code class="lang-XML">&lt;Button text=&quot;Sign in&quot; id=&quot;submit-button&quot;&gt;&lt;/Button&gt;
512512
</code></pre>
513513
<div class="exercise-end"></div>
@@ -539,7 +539,7 @@ <h4 class="exercise-start">
539539
<p>Once these files are in place the NativeScript framework knows how to pick the correct file; all you have to do is reference the image using <code>res://</code> and its base file name—i.e. <code>res://logo_login</code>. Here&#39;s what your login screen should look like on iOS and Android:</p>
540540
<p><img src="images/chapter2/ios/5.png" alt="login 5">
541541
<img src="images/chapter2/android/5.png" alt="login 5"></p>
542-
<p>At this point your UI looks good, but the app still doesn&#39;t actually do anything. Let&#39;s look at how you can use JavaScript to add some functionality.</p>
542+
<p>At this point your UI looks better visually, but the app still doesn&#39;t actually do anything. Let&#39;s look at how you can use JavaScript to add some functionality.</p>
543543
<blockquote>
544544
<p><strong>TIP</strong>: The community-written <a href="http://nsimage.brosteins.com/">NativeScript Image Builder</a> can help you generate images in the appropriate resolutions for iOS and Android.</p>
545545
</blockquote>

src/chapters/chapter2.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ TextField {
276276

277277
NativeScript supports CSS's `@import` statement for importing one CSS file into another. So this new line of code imports the CSS rules from `platform.css` into `app.css`. But, you might have noticed that Groceries does not have a file named `platform.css`—only `app/platform.android.css` and `app/platform.ios.css` exist. What's going on here?
278278

279-
<a id="platform-specific-files"></a>When you execute `tns run`, or `tns livesync`, the NativeScript CLI takes your code from the `app` folder and places it in the native projects located in the `platforms/ios` and `platforms/android` folders. Here the naming convention comes in: while moving files, the CLI intelligently selects `.android.*` and `.ios.*` files. To give a specific example, the CLI moves `platform.ios.css` into `platforms/ios` and renames it to `platform.css`; similarly, the CLI moves `platform.android.css` into `platforms/android`, and again renames it to `platform.css`. This convention provides a convenient way to branch your code to handle iOS and Android separately, and it's supported for any type of file in NativeScript—not just CSS files. You'll see a few more examples of this convention later in this guide.
279+
<a id="platform-specific-files"></a>When you execute `tns run`, or `tns livesync`, the NativeScript CLI takes the code from your `app` folder and places it in the native projects located in the `platforms/ios` and `platforms/android` folders. Here the naming convention comes in: while moving files, the CLI intelligently selects `.android.*` and `.ios.*` files. To give a specific example, the CLI moves `platform.ios.css` into `platforms/ios` and renames it to `platform.css`; similarly, the CLI moves `platform.android.css` into `platforms/android`, and again renames it to `platform.css`. This convention provides a convenient way to branch your code to handle iOS and Android separately, and it's supported for any type of file in NativeScript—not just CSS files. You'll see a few more examples of this convention later in this guide.
280280

281281
With these changes in place, you'll notice that the app has a bit more spacing, and also that the text fields have borders on iOS but that Android:
282282

@@ -293,7 +293,7 @@ Much like on the web, sometimes in your NativeScript apps you want to write CSS
293293
<b>Exercise</b>: Add component-specific CSS
294294
</h4>
295295

296-
Open your app’s `app/app.component.ts` file and add a `styleUrls` property such that that full `@Component` declaration now looks like this:
296+
Open your `app/app.component.ts` file and add a `styleUrls` property, so that that full `@Component` declaration now looks like this:
297297

298298
``` JavaScript
299299
@Component({
@@ -351,7 +351,7 @@ Before we see what your app looks like now, there’s one small change you need
351351
<b>Exercise</b>: Add an `id` attribute
352352
</h4>
353353

354-
Open your app’s `app/app.component.ts` file, find `<Button text="Sign in"></Button>` in your component’s `template`, and replace it with the code below:
354+
Open your `app/app.component.ts` file, find `<Button text="Sign in"></Button>` in your component’s `template`, and replace it with the code below:
355355

356356
``` XML
357357
<Button text="Sign in" id="submit-button"></Button>
@@ -405,6 +405,6 @@ Once these files are in place the NativeScript framework knows how to pick the c
405405
![login 5](images/chapter2/ios/5.png)
406406
![login 5](images/chapter2/android/5.png)
407407

408-
At this point your UI looks good, but the app still doesn't actually do anything. Let's look at how you can use JavaScript to add some functionality.
408+
At this point your UI looks better visually, but the app still doesn't actually do anything. Let's look at how you can use JavaScript to add some functionality.
409409

410410
> **TIP**: The community-written [NativeScript Image Builder](http://nsimage.brosteins.com/) can help you generate images in the appropriate resolutions for iOS and Android.

0 commit comments

Comments
 (0)