Skip to content

Commit

Permalink
docs: clean up docs
Browse files Browse the repository at this point in the history
  • Loading branch information
nartc committed Sep 14, 2023
1 parent c3edac5 commit 539a76e
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 19 deletions.
24 changes: 21 additions & 3 deletions docs/src/content/docs/getting-started/installation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,27 @@ ng add ngxtension
#### Nx CLI

<Tabs>
<TabItem label="npm">```shell npm install ngxtension ```</TabItem>
<TabItem label="yarn">```shell yarn add ngxtension ```</TabItem>
<TabItem label="pnpm">```shell pnpm install ngxtension ```</TabItem>
<TabItem label="npm">

```shell
npm install ngxtension
```

</TabItem>
<TabItem label="yarn">

```shell
yarn add ngxtension
```

</TabItem>
<TabItem label="pnpm">

```shell
pnpm install ngxtension
```

</TabItem>
</Tabs>

Then invoke the `ngxtension:init` generator
Expand Down
53 changes: 37 additions & 16 deletions docs/src/content/docs/utilities/resize.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -32,24 +32,28 @@ export class App {

<Tabs>
<TabItem label="html">
```html
<div (ngxResize)="onResize($event)">
<!-- content -->
</div>
```

```html
<div (ngxResize)="onResize($event)">
<!-- content -->
</div>
```

</TabItem>
<TabItem label="ts">
```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
}
}
```

</TabItem>
</Tabs>

Expand Down Expand Up @@ -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)],
};
```

0 comments on commit 539a76e

Please sign in to comment.