From d8fecb4d9942d3fbaecbbac0bbe0677a6b88d445 Mon Sep 17 00:00:00 2001 From: Alexey Pyltsyn Date: Fri, 4 Oct 2019 12:39:06 +0300 Subject: [PATCH] Improve docs --- docs/cookbook/tab-view-ng.md | 4 +- .../accessing-native-apis-with-javascript.md | 2 +- docs/core-concepts/angular-data-binding.md | 2 +- docs/core-concepts/angular-navigation.md | 112 +++++++++--------- docs/core-concepts/data-binding.md | 30 ++--- docs/core-concepts/error-handling.md | 16 +-- docs/core-concepts/memory-management.md | 2 +- docs/core-concepts/plugins.md | 2 +- docs/core-concepts/properties.md | 8 +- docs/core-concepts/utils.md | 72 +++++------ .../plugins/Android-Plugins-Infrastructure.md | 4 +- docs/plugins/implementing-core-theme.md | 4 +- docs/plugins/ui-plugin-custom.md | 4 +- .../user-guide/enterprise-auth/openid.md | 2 +- .../user-guide/enterprise-auth/saml.md | 2 +- docs/tooling/angular-cli.md | 2 +- docs/tooling/debugging/chrome-devtools.md | 2 +- .../continuous-integration.md | 2 +- .../end-to-end-testing/customization.md | 2 +- .../end-to-end-testing/getting-started.md | 6 +- 20 files changed, 141 insertions(+), 139 deletions(-) diff --git a/docs/cookbook/tab-view-ng.md b/docs/cookbook/tab-view-ng.md index f14980e50..5c139f9e5 100644 --- a/docs/cookbook/tab-view-ng.md +++ b/docs/cookbook/tab-view-ng.md @@ -112,8 +112,8 @@ export class DataItem { } @Component({ - selector: "tab-view-test", - templateUrl: "tab-view-test.html" + selector: "tab-view-test", + templateUrl: "tab-view-test.html" }) export class TabViewTest { public items: Array; diff --git a/docs/core-concepts/accessing-native-apis-with-javascript.md b/docs/core-concepts/accessing-native-apis-with-javascript.md index e8315c20a..1bc4efa56 100644 --- a/docs/core-concepts/accessing-native-apis-with-javascript.md +++ b/docs/core-concepts/accessing-native-apis-with-javascript.md @@ -149,7 +149,7 @@ let array = new NSMutableArray(); array.addObject(new NSObject()); ``` -This snippet creates an instance of `NSMutableArray` and adds an object to it using the `addObject(object)` method. Here is what happens behind the curtains: the `new NSMutableArray()` call is translated to a `[[NSMutableArray alloc] init]` call by the iOS Runtime. This instance is then wrapped in a JavaScript object and stored in the `array` variable. It contains all public properties and methods exposed by `NSMutableArray` (and its base classes) in its prototype chain. While the `addObject(object)` call is straightforward, calling Objective-C methods with more arguments follows several simple rules that define how Objective-C selectors are mapped to JavaScript functions. Let's consider the following `NSMutableArray` selector: `replaceObjectsInRange:withObjectsFromArray:range:`. In JavaScript it is represented by the following function: `replaceObjectsInRangeWithObjectsFromArrayRange(objectsToRange, souceArray, sourceRange)` (argument names are arbitrary). Note that the function name is generated by appending the names of the arguments as defined by the Objective-C selector by starting with a small letter for the first argument and appending each subsequent with a capital letter. +This snippet creates an instance of `NSMutableArray` and adds an object to it using the `addObject(object)` method. Here is what happens behind the curtains: the `new NSMutableArray()` call is translated to a `[[NSMutableArray alloc] init]` call by the iOS Runtime. This instance is then wrapped in a JavaScript object and stored in the `array` variable. It contains all public properties and methods exposed by `NSMutableArray` (and its base classes) in its prototype chain. While the `addObject(object)` call is straightforward, calling Objective-C methods with more arguments follows several simple rules that define how Objective-C selectors are mapped to JavaScript functions. Let's consider the following `NSMutableArray` selector: `replaceObjectsInRange:withObjectsFromArray:range:`. In JavaScript it is represented by the following function: `replaceObjectsInRangeWithObjectsFromArrayRange(objectsToRange, sourceArray, sourceRange)` (argument names are arbitrary). Note that the function name is generated by appending the names of the arguments as defined by the Objective-C selector by starting with a small letter for the first argument and appending each subsequent with a capital letter. #### NSDictionary diff --git a/docs/core-concepts/angular-data-binding.md b/docs/core-concepts/angular-data-binding.md index ccfba9204..366d02c9e 100644 --- a/docs/core-concepts/angular-data-binding.md +++ b/docs/core-concepts/angular-data-binding.md @@ -46,7 +46,7 @@ onButtonTap(args: EventData) { > Before we can use the ngModel directive in a two-way data binding, we must import the **NativeScriptFormsModule** and add it to the Angular module's imports list: > ```typescript -import {NativeScriptFormsModule} from "nativescript-angular/forms" +import { NativeScriptFormsModule } from "nativescript-angular/forms" @NgModule({ imports: [ NativeScriptModule, diff --git a/docs/core-concepts/angular-navigation.md b/docs/core-concepts/angular-navigation.md index 5a0b83b1e..9d854e136 100644 --- a/docs/core-concepts/angular-navigation.md +++ b/docs/core-concepts/angular-navigation.md @@ -67,8 +67,8 @@ import { RouterExtensions } from "nativescript-angular/router"; }) export class MainComponent { - constructor(private routerExtensions: RouterExtensions) { - } + constructor(private routerExtensions: RouterExtensions) { + } } ``` @@ -240,17 +240,17 @@ export class AppComponent { } import { Component, OnInit } from "@angular/core"; @Component({ - selector: "Hub", - templateUrl: "./hub.component.html", - styleUrls: ['./hub.component.css'] + selector: "Hub", + templateUrl: "./hub.component.html", + styleUrls: ['./hub.component.css'] }) export class HubComponent implements OnInit { - constructor() { - } + constructor() { + } - ngOnInit(): void { - } + ngOnInit(): void { + } } ``` ```hub.component.html @@ -268,21 +268,21 @@ import { Component, OnInit } from "@angular/core"; import { Location } from "@angular/common"; @Component({ - selector: "Featured", - templateUrl: "./featured.component.html", - styleUrls: ['./featured.component.css'] + selector: "Featured", + templateUrl: "./featured.component.html", + styleUrls: ['./featured.component.css'] }) export class FeaturedComponent implements OnInit { - constructor(private location: Location) { - } + constructor(private location: Location) { + } - ngOnInit(): void { - } + ngOnInit(): void { + } - goBack(): void { - this.location.back(); - } + goBack(): void { + this.location.back(); + } } ``` ```featured.component.html @@ -372,17 +372,17 @@ import { Component, OnInit } from "@angular/core"; import { RouterExtensions } from "nativescript-angular/router"; @Component({ - selector: "Featured", - templateUrl: "./featured.component.html", - styleUrls: ['./featured.component.css'] + selector: "Featured", + templateUrl: "./featured.component.html", + styleUrls: ['./featured.component.css'] }) export class FeaturedComponent implements OnInit { - constructor(private routerExtensions: RouterExtensions) { - } + constructor(private routerExtensions: RouterExtensions) { + } - ngOnInit(): void { - } + ngOnInit(): void { + } } ``` ```featured.component.html @@ -398,17 +398,17 @@ export class FeaturedComponent implements OnInit { import { Component, OnInit } from "@angular/core"; @Component({ - selector: "Item", - templateUrl: "./item.component.html", - styleUrls: ['./item.component.css'] + selector: "Item", + templateUrl: "./item.component.html", + styleUrls: ['./item.component.css'] }) export class ItemComponent implements OnInit { - constructor() { - } + constructor() { + } - ngOnInit(): void { - } + ngOnInit(): void { + } } ``` ```item.component.html @@ -434,21 +434,21 @@ import { Component, OnInit } from "@angular/core"; import { RouterExtensions } from "nativescript-angular/router"; @Component({ - selector: "Item", - templateUrl: "./item.component.html", - styleUrls: ['./item.component.css'] + selector: "Item", + templateUrl: "./item.component.html", + styleUrls: ['./item.component.css'] }) export class ItemComponent implements OnInit { - constructor(private routerExtensions: RouterExtensions) { - } + constructor(private routerExtensions: RouterExtensions) { + } - ngOnInit(): void { - } + ngOnInit(): void { + } - goBack(): void { - this.routerExtensions.back(); - } + goBack(): void { + this.routerExtensions.back(); + } } ``` ```item.component.html @@ -561,11 +561,11 @@ import { Component, OnInit } from "@angular/core"; }) export class HubComponent implements OnInit { - constructor() { - } + constructor() { + } - ngOnInit(): void { - } + ngOnInit(): void { + } } ``` ```hub.component.html @@ -620,7 +620,7 @@ The `TabView` component enables the user to arbitrarily navigate between several ![navigation-diagram-ng-tab](../img/navigation/navigation-diagram-ng-tab.png?raw=true) -The `BottomNavigation` container provides its lateral navigation logic automatically by providing the user with tabs which they can select. To set up a `BottomNavigation` you need to simply declare the UI of each container via a `TabItemContent` and set the title and icon via coresponding `tabStripItem` (details on the basic structure [here](http://localhost:9192/angular/ui/ng-ui-widgets/bottom-navigation#usage)). Each separate UI container is represented by the `TabContentItem` component. As with other containers, you can enable forward and backward navigation inside each of them by embedding a `page-router-outlet` in it. In this case we need to use three sibling outlets. The way to do this with the Angular router is to use [named outlets](https://angular.io/guide/router#displaying-multiple-routes-in-named-outlets). Each of our outlets will be named with the name of the feature that it represents. +The `BottomNavigation` container provides its lateral navigation logic automatically by providing the user with tabs which they can select. To set up a `BottomNavigation` you need to simply declare the UI of each container via a `TabItemContent` and set the title and icon via corresponding `tabStripItem` (details on the basic structure [here](http://localhost:9192/angular/ui/ng-ui-widgets/bottom-navigation#usage)). Each separate UI container is represented by the `TabContentItem` component. As with other containers, you can enable forward and backward navigation inside each of them by embedding a `page-router-outlet` in it. In this case we need to use three sibling outlets. The way to do this with the Angular router is to use [named outlets](https://angular.io/guide/router#displaying-multiple-routes-in-named-outlets). Each of our outlets will be named with the name of the feature that it represents. The `BottomNavigation` widget also provides two important features connected to lateral navigation: @@ -712,7 +712,7 @@ export class AppComponent { ```app.component.html - + @@ -747,17 +747,17 @@ export class AppComponent { import { Component, OnInit } from "@angular/core"; @Component({ - selector: "Featured", - templateUrl: "./featured.component.html", - styleUrls: ['./featured.component.css'] + selector: "Featured", + templateUrl: "./featured.component.html", + styleUrls: ['./featured.component.css'] }) export class FeaturedComponent implements OnInit { - constructor() { - } + constructor() { + } - ngOnInit(): void { - } + ngOnInit(): void { + } } ``` ```featured.component.html diff --git a/docs/core-concepts/data-binding.md b/docs/core-concepts/data-binding.md index 5c083dd18..83e622bd0 100644 --- a/docs/core-concepts/data-binding.md +++ b/docs/core-concepts/data-binding.md @@ -240,22 +240,22 @@ Another common case in working with bindings is requesting access to the parent _Example 4: Creating ListView child items based on the itemTemplate._ ``` XML - {%raw%} - - - - -