From 539a76eeb991a5940843f25054db5367e92d2455 Mon Sep 17 00:00:00 2001 From: Chau Tran Date: Thu, 14 Sep 2023 09:56:10 -0500 Subject: [PATCH] docs: clean up docs --- .../docs/getting-started/installation.mdx | 24 +++++++-- docs/src/content/docs/utilities/resize.mdx | 53 +++++++++++++------ 2 files changed, 58 insertions(+), 19 deletions(-) diff --git a/docs/src/content/docs/getting-started/installation.mdx b/docs/src/content/docs/getting-started/installation.mdx index 21ebaf92..be25505d 100644 --- a/docs/src/content/docs/getting-started/installation.mdx +++ b/docs/src/content/docs/getting-started/installation.mdx @@ -21,9 +21,27 @@ ng add ngxtension #### Nx CLI - ```shell npm install ngxtension ``` - ```shell yarn add ngxtension ``` - ```shell pnpm install ngxtension ``` + + +```shell + npm install ngxtension +``` + + + + +```shell +yarn add ngxtension +``` + + + + +```shell +pnpm install ngxtension +``` + + Then invoke the `ngxtension:init` generator diff --git a/docs/src/content/docs/utilities/resize.mdx b/docs/src/content/docs/utilities/resize.mdx index 18f50ca0..04a176c0 100644 --- a/docs/src/content/docs/utilities/resize.mdx +++ b/docs/src/content/docs/utilities/resize.mdx @@ -32,24 +32,28 @@ export class App { - ```html -
- -
- ``` + +```html +
+ +
+``` +
- ```ts - @Component({ - imports: [NgxResize], - templateUrl: './app.html' - }) - export class App { - onResize(event: ResizeResult) { - // runs outside of Angular Zone by default - } - } - ``` + +```ts +@Component({ + imports: [NgxResize], + templateUrl: './app.html', +}) +export class App { + onResize(event: ResizeResult) { + // runs outside of Angular Zone by default + } +} +``` +
@@ -82,3 +86,20 @@ injectResize(someOptions); ``` To provide `ResizeOptions` globally to the application or to a sub component tree (via `Route#providers`), we can use `provideResizeOptions()` + +```ts +// Standalone +bootstrapApplication(App, { providers: [provideResizeOptions(globalOptions)] }); + +// AppModule +@NgModule({ + providers: [provideResizeOptions(globalOptions)], +}) +export class AppModule {} + +// Route#provider (equivalent to Lazy-load modules) +const route = { + path: 'some-path', + providers: [provideResizeOptions(subTreeGlobalOptions)], +}; +```