Skip to content

Commit 49e211f

Browse files
committed
feat(demo): improve dynamic example docs
1 parent c23b904 commit 49e211f

File tree

5 files changed

+23
-3
lines changed

5 files changed

+23
-3
lines changed

projects/elements-demo/src/app/features/examples/dynamic/dynamic.component.html

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,18 @@ <h2>Dynamic element tag</h2>
2626
loadingTemplate: loading;
2727
module: true
2828
"
29-
[outlined]="true"
29+
[outlined]="buttonTypeIsOutlined"
30+
[raised]="!buttonTypeIsOutlined"
3031
(click)="increment1()"
3132
>
3233
Increment
3334
</ax-lazy-element>
3435
<p>Counter: {{ counter1 }}</p>
36+
<div class="controls">
37+
<span>Raised button</span>
38+
<mat-slide-toggle [(ngModel)]="buttonTypeIsOutlined"></mat-slide-toggle>
39+
<span>Outline button</span>
40+
</div>
3541
</div>
3642
<div class="description">
3743
<p>

projects/elements-demo/src/app/features/examples/dynamic/dynamic.component.scss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,15 @@
2929
.description {
3030
flex: 1.5;
3131
}
32+
33+
.controls {
34+
display: flex;
35+
align-items: center;
36+
37+
span {
38+
padding: 20px;
39+
}
40+
}
3241
}
3342
}
3443

projects/elements-demo/src/app/features/examples/dynamic/dynamic.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export class DynamicComponent implements OnInit {
1616
codeExample2html = CODE_EXAMPLE_2_HTML;
1717

1818
// example state
19+
buttonTypeIsOutlined = true;
1920
counter1 = 0;
2021
counter2 = 0;
2122

projects/elements-demo/src/app/features/examples/dynamic/dynamic.module.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
22
import { HighlightModule } from 'ngx-highlightjs';
3+
import { FormsModule } from '@angular/forms';
34

45
import {
56
LazyElementModuleOptions,
@@ -26,6 +27,7 @@ const options: LazyElementModuleOptions = {
2627
declarations: [DynamicComponent],
2728
imports: [
2829
HighlightModule,
30+
FormsModule,
2931
LazyElementsModule.forFeature(options),
3032
SharedModule,
3133
DynamicRoutingModule

projects/elements-demo/src/app/shared/shared.module.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ import {
1414
MatExpansionModule,
1515
MatSnackBarModule,
1616
MatSliderModule,
17-
MatFormFieldModule
17+
MatFormFieldModule,
18+
MatSlideToggleModule
1819
} from '@angular/material';
1920
import { SpinnerComponent } from './spinner/spinner.component';
2021
import { ErrorComponent } from './error/error.component';
@@ -32,7 +33,8 @@ const ANGULAR_MATERIAL_MODULES = [
3233
MatExpansionModule,
3334
MatSnackBarModule,
3435
MatSliderModule,
35-
MatFormFieldModule
36+
MatFormFieldModule,
37+
MatSlideToggleModule
3638
];
3739

3840
@NgModule({

0 commit comments

Comments
 (0)