Skip to content

Commit 5748d32

Browse files
committed
small changes for consistency and fixing small mistakes
1 parent 11e7358 commit 5748d32

File tree

2 files changed

+19
-9
lines changed

2 files changed

+19
-9
lines changed

src/chapters/chapter0.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ Welcome to the NativeScript & Angular 2 getting started guide 📚. In this hand
88
99
### What is NativeScript? What is Angular 2?
1010

11-
[NativeScript](https://www.nativescript.org/) is a framework for building native iOS and Android apps using JavaScript and CSS. NativeScript renders UIs with the native platform’s rendering engine—no [WebViews](http://developer.telerik.com/featured/what-is-a-webview/)—resulting in native-like performance and UX. Angular JS is one of the most popular open source JavaScript frameworks for application development.
11+
[NativeScript](https://www.nativescript.org/) is a framework for building native iOS and Android apps using JavaScript and CSS. NativeScript renders UIs with the native platform’s rendering engine—no [WebViews](http://developer.telerik.com/featured/what-is-a-webview/)—resulting in native-like performance and UX. [Angular JS](https://angularjs.org/) is one of the most popular open source JavaScript frameworks for application development.
1212

1313
The latest version of Angular, [Angular 2](https://angular.io/), makes it possible to use Angular outside of a web browser, and developers at [Telerik](http://www.telerik.com/) (the company that created and maintains NativeScript) [have been working closely with developers at Google](https://docs.google.com/document/d/1J6fZcVbVa6uONVCJIox2A3Jn5TWgspLufmryfA1OXGk/edit#heading=h.trgonlvb0z3j) to make Angular 2 in NativeScript a reality.
1414

15-
The result is a framework that allows you to build mobile apps using the same framework—and in some cases the same code—that you use to build Angular 2 web apps, with the performance you’d expect from native code. Let’s look at how it all works by building an app.
15+
The result is a software architecture that allows you to build mobile apps using the same framework—and in some cases the same code—that you use to build Angular 2 web apps, with the performance you’d expect from native code. Let’s look at how it all works by building an app.
1616

1717
> **WARNING**: Although NativeScript itself is a production-ready framework that drives [many apps in the app stores today](https://www.nativescript.org/showcases), NativeScript’s Angular integration is still in an alpha stage. If you run into issues when using the Angular integration, please report them on https://github.com/NativeScript/nativescript-angular. If you’re looking for a guide on using the production-ready flavor of NativeScript, head to the [official Getting Started Guide](http://docs.nativescript.org/start/getting-started).
1818

src/chapters/chapter2.md

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ To keep things simple, let's start by looking at the outer structure of the Groc
1313
└── sample-Groceries
1414
├── app
1515
│ └── ...
16+
├── hooks
17+
├── lib
1618
├── node_modules
1719
│ ├── angular2
1820
│ ├── nativescript-angular
@@ -22,19 +24,23 @@ To keep things simple, let's start by looking at the outer structure of the Groc
2224
│ ├── android
2325
│ └── ios
2426
├── package.json
27+
├── references.d.ts
2528
└── tsconfig.json
2629
2730
```
2831

2932
Here's what these various files and folders do:
3033

3134
- **app**: This folder contains all the development resources you need to build your app. You'll be spending most of your time editing the files in here.
35+
- **hooks**: This folder contains a series of files that manage the lifecycles of Angular components.
36+
- **lib**: This folder contains libraries offering third-party functionality; in this case, the TelerikUI.framework required at the end of this tutorial.
3237
- **node_modules**: This folder contains your app's npm module dependencies, including Angular 2, TypeScript, and the other modules NativeScript needs to build your app.
3338
- **node_modules/angular2**: This folder contains the Angular 2 source code. NativeScript does not alter the core Angular 2 source code in any way, instead, NativeScript builds on top of Angular 2 with the nativescript-angular npm module.
3439
- **node_modules/nativescript-angular**: This folder contains the module that integrates NativeScript-specific functionality into Angular 2. The source code for this module lives at <https://github.com/NativeScript/nativescript-angular>.
3540
- **node_modules/tns-core-modules**: This folder contains your app's NativeScript modules, which are a series of NativeScript-provided JavaScript modules you'll use to build your app. Each module contains the platform-specific code needed to implement some feature—the camera, http calls, the file system, and so forth—exposed through a platform-agnostic API (e.g. `camera.takePicture()`). We'll look at some examples in [chapter 4](#chapter4). The source code for these modules lives at <https://github.com/NativeScript/nativescript>.
3641
- **platforms**: This folder contains the platform-specific code NativeScript needs to build native iOS and Android apps. For example in the `android` folder you'll find things like your project's `AndroidManifest.xml` and .apk executable files. Similarly, the `ios` folder contains the Groceries' Xcode project and .ipa executables. Note, users on Windows machines will not have an `ios` folder.
3742
- **package.json**: This file contains your app's configuration details, such as your app id, the version of NativeScript you're using, and also which npm modules your app uses. We'll take a closer look at how to use this file when we talk about using npm modules in [chapter 5](#plugins-and-npm-modules).
43+
- **references.d.ts**: This file is a helper utility for typescript to help with autocompletion and compilation.
3844
- **tsconfig.json**: This file contains your app’s TypeScript configuration. Unless you have existing TypeScript expertise, you’ll probably want to leave this file alone for now. If you do have existing experience you may want to tweak these values to suit your personal preferences, however, note that the `"experimentalDecorators"` and `"emitDecoratorMetadata"` flags are essential to making NativeScript and Angular 2 work, so don’t remove those. You can refer to the official TypeScript wiki for [detailed documentation on what you can do in a `tsconfig.json` file](https://github.com/Microsoft/TypeScript/wiki/tsconfig.json).
3945

4046
The NativeScript CLI manages the `platforms` folder for you as you develop and run your app; therefore, it's a best practice to treat the `platforms` folder as generated code. The Groceries app includes the `platforms` folder in its [`.gitignore`](https://github.com/NativeScript/sample-Groceries/blob/master/.gitignore) to exclude its files from source control.
@@ -49,10 +55,14 @@ Next, let's dig into the `app` folder, as that's where you'll be spending the ma
4955
│ │ ├── Android
5056
│ │ └── iOS
5157
│ ├── pages
52-
│ │ ├── login.component.ts
58+
│ │ ├── list
59+
│ │ │ ├── list.html
60+
│ │ │ └── ...
5361
│ │ └── ...
5462
│ ├── shared
5563
│ │ └── ...
64+
│ ├── utils
65+
│ │ └── ...
5666
│ ├── app.css
5767
│ ├── app.component.ts
5868
│ ├── main.ts
@@ -62,13 +72,13 @@ Next, let's dig into the `app` folder, as that's where you'll be spending the ma
6272
Here's what these various files and folders do:
6373

6474
- **App_Resources**: This folder contains platform-specific resources such as icons, splash screens, and configuration files. The NativeScript CLI takes care of injecting these resources into the appropriate places in the `platforms` folder when you execute `tns run`.
65-
- **pages**: This folder, specific to the Groceries app, contains the code to build your app's pages. Each page is made up of a TypeScript file and an optional HTML file. The Groceries app starts with three TypeScript files for its three pages—a login page, a registration page, and a list page. In a more complex app you may wish to create a more detailed folder structure within `pages`, but for now, keeping all pages in the root keeps our demo simple.
66-
- **shared**: This folder, also specific to the Groceries app, contains any files you need to share between NativeScript apps and Angular-2-built web apps. For Groceries this includes a few classes for talking to backend services, a few model objects, and a `config.ts` file used to share configuration variables like API keys. We’ll discuss the `shared` folder, as well as code sharing between native apps and web apps, in detail in section 3.2.
75+
- **pages**: This folder, specific to the Groceries app, contains the code to build your app's pages. Each page is made up of a TypeScript file and an optional HTML file. The Groceries app starts with three TypeScript files for its three pages—a login page, a registration page, and a list page, kept in their respective folders.
76+
- **shared**: This folder, also specific to the Groceries app, contains any files you need to share between NativeScript apps and Angular-2-built web apps. For Groceries this includes folders containing files with a few classes for talking to backend services, a few model objects, and a `config.ts` file used to share configuration variables like API keys. We’ll discuss the `shared` folder, as well as code sharing between native apps and web apps, in detail in section 3.2.
6777
- **app.css**: This file contains global styles for your app. We'll dig into app styling in [section 2.3](#css).
6878
- **app.component.ts**: This primary Angular component that drives your application. Eventually this file will handle routing and application-wide configuration, however for now the file has a simple hello world example that we’ll look at momentarily.
6979
- **main.ts**: The starting point of Angular 2 applications—web and native.
7080

71-
To get a sense of a NativeScript app actually starts up, let’s dig in to the first few files.
81+
To get a sense of a NativeScript app actually starts up, let’s explore the first few files.
7282

7383
### Starting up
7484

@@ -173,7 +183,7 @@ NativeScript provides several different layout containers that allow you to plac
173183
- The [Stack Layout](http://docs.nativescript.org/ApiReference/ui/layouts/stack-layout/HOW-TO.html) lets you stack child UI elements either vertically or horizontally.
174184
- The [Wrap Layout](http://docs.nativescript.org/ApiReference/ui/layouts/wrap-layout/HOW-TO.html) lets child UI elements flow from one row or column to the next when space is filled.
175185

176-
For your login screen, all you need is a simple `<stack-layout>` to stack the UI elements on top of each other. In later sections, you'll use some of the more advanced layouts.
186+
For your login screen, all you need is a simple `<StackLayout>` to stack the UI elements on top of each other. In later sections, you'll use some of the more advanced layouts.
177187

178188
<h4 class="exercise-start">
179189
<b>Exercise</b>: Add a stack layout to the login screen
@@ -262,9 +272,9 @@ Add the following as the first line of your app's `app.css` file:
262272
``` CSS
263273
@import { url('~/platform.css') };
264274
```
265-
> **WARNING**: NativeScript is consistent with browser implementations, in that `@import` statements must precede all other CSS rules in a file.
275+
> **WARNING**: NativeScript is consistent with browser implementations in that `@import` statements must precede all other CSS rules in a file.
266276
267-
Next, add a `class="link"` attribute to the sign up button in `login.xml`. The button's markup should look like this:
277+
Next, add a `class="link"` attribute to the sign up button in `login/login.html`. The button's markup should look like this:
268278

269279
``` XML
270280
<Button text="Sign up for Groceries" class="link" />

0 commit comments

Comments
 (0)