Skip to content

Commit 96f9a97

Browse files
committed
Adding an intro to chapter 4
1 parent cd69e74 commit 96f9a97

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

index.html

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1030,7 +1030,18 @@ <h4 class="exercise-start">
10301030
</div>
10311031
<div class="chapter">
10321032
<h2 id="nativescript-modules">NativeScript modules</h2>
1033-
<p>Explain what modules are. Should be able to copy content almost verbatim from the current guide.</p>
1033+
<p>In this chapter you&#39;ll learn about NativeScript modules, which are the JavaScript modules in your app&#39;s <code>node_modules/tns-core-modules</code> folder. Whether you&#39;ve realized it or not, you&#39;ve already used several NativeScript modules, as all of the NativeScript UI elements are actually implemented with JavaScript code.</p>
1034+
<p>If you dig into <code>node_modules/tns-core-modules</code> you can get an idea of how these modules work. Start by finding the <code>node_modules/tns-core-modules/camera</code> folder, which includes the implementation of the camera module. It includes:</p>
1035+
<ul>
1036+
<li>a <code>package.json</code> file that sets the name of the module;</li>
1037+
<li>a file containing the module&#39;s Android implementation (<code>camera.android.js</code>);</li>
1038+
<li>a file containing the module&#39;s iOS implementation (<code>camera.ios.js</code>);</li>
1039+
<li>a file containing code shared by the Android and iOS implementations (<code>camera-common.js</code>)</li>
1040+
</ul>
1041+
<blockquote>
1042+
<p><strong>NOTE</strong>: You can refer to the <a href="https://nodejs.org/api/modules.html#modules_folders_as_modules">Node.js documentation on folders as modules</a> for more detailed information on how NativeScript organizes its modules.</p>
1043+
</blockquote>
1044+
<p>The *.ios.* and *.android.* naming convention should look familiar, as it’s the exact same convention we used to include Android- and iOS-specific styling in <a href="#css">chapter 2.3</a>. NativeScript uses this same convention to implement its modules on iOS and Android. Now that you know where these modules are, let&#39;s take a closer look at what else they can do for your app, starting with a closer looks at what you can do with NativeScript’s UI elements.</p>
10341045
<h3 id="ui-elements">UI elements</h3>
10351046
<p>Explain that UI elements are actually NativeScript modules. Say that we’re going to make this app look nice—it’s a native app after all.</p>
10361047
<h4 class="exercise-start">

src/chapters/chapter4.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
## NativeScript modules
22

3-
Explain what modules are. Should be able to copy content almost verbatim from the current guide.
3+
In this chapter you'll learn about NativeScript modules, which are the JavaScript modules in your app's `node_modules/tns-core-modules` folder. Whether you've realized it or not, you've already used several NativeScript modules, as all of the NativeScript UI elements are actually implemented with JavaScript code.
4+
5+
If you dig into `node_modules/tns-core-modules` you can get an idea of how these modules work. Start by finding the `node_modules/tns-core-modules/camera` folder, which includes the implementation of the camera module. It includes:
6+
7+
- a `package.json` file that sets the name of the module;
8+
- a file containing the module's Android implementation (`camera.android.js`);
9+
- a file containing the module's iOS implementation (`camera.ios.js`);
10+
- a file containing code shared by the Android and iOS implementations (`camera-common.js`)
11+
12+
> **NOTE**: You can refer to the [Node.js documentation on folders as modules](https://nodejs.org/api/modules.html#modules_folders_as_modules) for more detailed information on how NativeScript organizes its modules.
13+
14+
The \*.ios.\* and \*.android.\* naming convention should look familiar, as it’s the exact same convention we used to include Android- and iOS-specific styling in [chapter 2.3](#css). NativeScript uses this same convention to implement its modules on iOS and Android. Now that you know where these modules are, let's take a closer look at what else they can do for your app, starting with a closer looks at what you can do with NativeScript’s UI elements.
415

516
### UI elements
617

0 commit comments

Comments
 (0)