Skip to content

Commit

Permalink
chore(demo): update getting started page with standalone example (#4963)
Browse files Browse the repository at this point in the history
Co-authored-by: Evgeniy Shevtsov <[email protected]>
  • Loading branch information
PblCbGomel and Evgeniy Shevtsov authored Aug 1, 2023
1 parent e86244c commit 9a0578f
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 3 deletions.
16 changes: 16 additions & 0 deletions projects/demo/src/modules/app/home/examples/app-standalone.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
```ts
import {Component} from '@angular/core';
import {TuiRootModule} from '@taiga-ui/core';

@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./my.component.scss', './my.component.less'],
standalone: true,
imports: [
TuiRootModule,
// ...
],
})
export class AppComponent {}
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
```ts
import {provideAnimations} from '@angular/platform-browser/animations';
import {TuiAlertModule, TuiDialogModule, TuiRootModule} from '@taiga-ui/core';

bootstrapApplication(AppComponent, {
providers: [importProvidersFrom(TuiRootModule, TuiDialogModule, TuiAlertModule), provideAnimations()],
}).catch(err => console.error(err));
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
```ts
import {provideAnimations} from '@angular/platform-browser/animations';
import {TuiRootModule} from '@taiga-ui/core';

bootstrapApplication(AppComponent, {
providers: [importProvidersFrom(TuiRootModule), provideAnimations()],
}).catch(err => console.error(err));
```
5 changes: 5 additions & 0 deletions projects/demo/src/modules/app/home/home.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ export class HomeComponent {
readonly addons = import('./examples/addons.md?raw');
readonly nxAdd = import('./examples/nx-add.md?raw');
readonly nxMigrate = import('./examples/nx-migrate.md?raw');
readonly standalone = import('./examples/app-standalone.md?raw');
readonly standaloneMain = import('./examples/main-standalone.md?raw');
readonly standaloneMainOptional = import(
'./examples/main-standalone-optional.md?raw'
);

readonly customGlobalStyle = import(
'../../../../../styles/taiga-ui-global.less?raw'
Expand Down
39 changes: 36 additions & 3 deletions projects/demo/src/modules/app/home/home.template.html
Original file line number Diff line number Diff line change
Expand Up @@ -186,17 +186,50 @@ <h2>Install Taiga UI</h2>
filename="app.component.html"
[code]="appTemplate"
></tui-doc-code>

<p>
If you're using
<code>standalone</code>
components:
</p>

<tui-doc-code
filename="app.component.ts"
[code]="standalone"
></tui-doc-code>

<tui-doc-code
filename="main.ts"
[code]="standaloneMain"
></tui-doc-code>
</li>

<li id="options">
Taiga UI also has optional modules for dialogs and notifications. If you need these features, add
modules into your app.module.ts
<p>
Taiga UI also has optional modules for dialogs and notifications. If you need these features, add
modules into your app.module.ts
</p>

<tui-doc-code
filename="app.module.ts"
class="tui-space_bottom-4"
[code]="appModuleOptional"
></tui-doc-code>

<p>
or for
<code>standalone</code>
components:
</p>

<tui-doc-code
filename="app.component.ts"
[code]="standalone"
></tui-doc-code>

<tui-doc-code
filename="main.ts"
[code]="standaloneMainOptional"
></tui-doc-code>
</li>

<li id="icons">
Expand Down

0 comments on commit 9a0578f

Please sign in to comment.