Skip to content

docs: update quick-setup link #2179

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DevelopmentWorkflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

Install your native toolchain and NativeScript as described in the docs:

https://docs.nativescript.org/setup/quick-setup
https://docs.nativescript.org/angular/start/quick-setup

### Clone repository

Expand Down
2 changes: 2 additions & 0 deletions nativescript-angular/directives/templated-items-comp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ import {
ViewContainerRef,
ɵisListLikeIterable as isListLikeIterable
} from "@angular/core";
// tslint:disable: max-line-length
// TODO: refactor core module imports to allow this to work properly
// import { View, LayoutBase, KeyedTemplate, ItemEventData, TemplatedItemsView, ObservableArray } from "@nativescript/core";
// Ivy entry points get out of order and will cause issues like this:
// node_modules/@nativescript/core/ui/html-view/html-view-common.js:26:0: JS ERROR TypeError: undefined is not an object (evaluating 'color_1.Color.equals') if not using deep imports like the following for the moment
// tslint:enable: max-line-length
import { ItemEventData, TemplatedItemsView } from "@nativescript/core/ui/list-view";
import { View, KeyedTemplate } from "@nativescript/core/ui/core/view";
import { LayoutBase } from "@nativescript/core/ui/layouts/layout-base";
Expand Down
134 changes: 68 additions & 66 deletions nativescript-angular/platform-common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import "nativescript-intl";
import { TextView } from "@nativescript/core/ui/text-view";
import { Color, View } from "@nativescript/core/ui/core/view";
import { Frame } from "@nativescript/core/ui/frame";
import { GridLayout } from '@nativescript/core/ui/layouts/grid-layout';
import { GridLayout } from "@nativescript/core/ui/layouts/grid-layout";

import {
Type,
Expand Down Expand Up @@ -76,8 +76,8 @@ export interface HmrOptions {
// tslint:enable:max-line-length

export interface AppLaunchView extends View {
startAnimation?: () => void;
cleanup?: () => void;
startAnimation?: () => void;
cleanup?: () => void;
}

export interface AppOptions {
Expand Down Expand Up @@ -209,50 +209,52 @@ export class NativeScriptPlatformRef extends PlatformRef {
}

if (this.appOptions && this.appOptions.launchView) {
launchView = this.appOptions.launchView;
if (this.appOptions.launchView.startAnimation) {
setTimeout(() => {
// ensure launch animation is executed after launchView added to view stack
this.appOptions.launchView.startAnimation();
});
}
launchView = this.appOptions.launchView;
if (this.appOptions.launchView.startAnimation) {
setTimeout(() => {
// ensure launch animation is executed after launchView added to view stack
this.appOptions.launchView.startAnimation();
});
}
} else {
launchView = new GridLayout();
// Custom launch view color (useful when doing async app intializers where you don't want a flash of undesirable color)
launchView.backgroundColor = new Color(this.appOptions && this.appOptions.backgroundColor ? this.appOptions.backgroundColor : '#fff');
launchView = new GridLayout();
// Custom launch view color (useful when doing async app intializers
// where you don't want a flash of undesirable color).
const bgCol = this.appOptions && this.appOptions.backgroundColor ? this.appOptions.backgroundColor : "#fff";
launchView.backgroundColor = new Color(bgCol);
}
args.root = launchView;
setRootPage(<any>launchView);

// Launch Angular app
this._bootstrapper().then(
moduleRef => {

if (isLogEnabled()) {
bootstrapLog(`Angular bootstrap bootstrap done. uptime: ${uptime()}`);
}

rootContent = launchView;
if (launchView && launchView.cleanup) {
// cleanup any custom launch views
launchView.cleanup();
}

lastBootstrappedModule = new WeakRef(moduleRef);
},
err => {

const errorMessage = err.message + "\n\n" + err.stack;
if (isLogEnabled()) {
bootstrapLogError("ERROR BOOTSTRAPPING ANGULAR");
}
if (isLogEnabled()) {
bootstrapLogError(errorMessage);
}

rootContent = this.createErrorUI(errorMessage);
}
);
moduleRef => {

if (isLogEnabled()) {
bootstrapLog(`Angular bootstrap bootstrap done. uptime: ${uptime()}`);
}

rootContent = launchView;
if (launchView && launchView.cleanup) {
// cleanup any custom launch views
launchView.cleanup();
}

lastBootstrappedModule = new WeakRef(moduleRef);
},
err => {

const errorMessage = err.message + "\n\n" + err.stack;
if (isLogEnabled()) {
bootstrapLogError("ERROR BOOTSTRAPPING ANGULAR");
}
if (isLogEnabled()) {
bootstrapLogError(errorMessage);
}

rootContent = this.createErrorUI(errorMessage);
}
);
}
);
const exitCallback = profile(
Expand Down Expand Up @@ -293,32 +295,32 @@ export class NativeScriptPlatformRef extends PlatformRef {
}

this._bootstrapper().then(
moduleRef => {
if (isLogEnabled()) {
bootstrapLog("Angular livesync done.");
}
onAfterLivesync.next({ moduleRef });

lastBootstrappedModule = new WeakRef(moduleRef);
applicationRerun({
create: () => getRootPage(),
});
},
error => {
if (isLogEnabled()) {
bootstrapLogError("ERROR LIVESYNC BOOTSTRAPPING ANGULAR");
}
const errorMessage = error.message + "\n\n" + error.stack;
if (isLogEnabled()) {
bootstrapLogError(errorMessage);
}

applicationRerun({
create: () => this.createErrorUI(errorMessage),
});
onAfterLivesync.next({ error });
}
);
moduleRef => {
if (isLogEnabled()) {
bootstrapLog("Angular livesync done.");
}
onAfterLivesync.next({ moduleRef });

lastBootstrappedModule = new WeakRef(moduleRef);
applicationRerun({
create: () => getRootPage(),
});
},
error => {
if (isLogEnabled()) {
bootstrapLogError("ERROR LIVESYNC BOOTSTRAPPING ANGULAR");
}
const errorMessage = error.message + "\n\n" + error.stack;
if (isLogEnabled()) {
bootstrapLogError(errorMessage);
}

applicationRerun({
create: () => this.createErrorUI(errorMessage),
});
onAfterLivesync.next({ error });
}
);
}

private createErrorUI(message: string): View {
Expand Down
2 changes: 1 addition & 1 deletion nativescript-angular/router/router.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export class NativeScriptRouterModule {
return {
ngModule: NativeScriptRouterModule,
providers: [
...RouterModule.forRoot(routes, config).providers,
...RouterModule.forRoot(routes, config).providers,
{
provide: NSLocationStrategy,
useFactory: provideLocationStrategy,
Expand Down
4 changes: 0 additions & 4 deletions nativescript-angular/tslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,9 @@
"rules":{
"directive-selector": [true, "attribute", "ns", "camelCase"],
"component-selector": [true, "element", "", "camelCase"],
"use-input-property-decorator": true,
"use-output-property-decorator": true,
"no-input-rename": true,
"no-output-rename": true,
"use-pipe-transform-interface": true,
"pipe-naming": [true, "camelCase", "ns"],
"component-class-suffix": true,
"directive-class-suffix": true,
"member-access": false,
Expand Down Expand Up @@ -60,7 +57,6 @@
"no-string-literal": false,
"no-switch-case-fall-through": true,
"no-unused-expression": true,
"no-unused-variable": true,
"no-var-keyword": true,
"radix": false,
"switch-default": true,
Expand Down