Skip to content

Commit

Permalink
feat(demo): improve dynamic example docs
Browse files Browse the repository at this point in the history
  • Loading branch information
tomastrajan committed Sep 28, 2019
1 parent c23b904 commit 49e211f
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,18 @@ <h2>Dynamic element tag</h2>
loadingTemplate: loading;
module: true
"
[outlined]="true"
[outlined]="buttonTypeIsOutlined"
[raised]="!buttonTypeIsOutlined"
(click)="increment1()"
>
Increment
</ax-lazy-element>
<p>Counter: {{ counter1 }}</p>
<div class="controls">
<span>Raised button</span>
<mat-slide-toggle [(ngModel)]="buttonTypeIsOutlined"></mat-slide-toggle>
<span>Outline button</span>
</div>
</div>
<div class="description">
<p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@
.description {
flex: 1.5;
}

.controls {
display: flex;
align-items: center;

span {
padding: 20px;
}
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export class DynamicComponent implements OnInit {
codeExample2html = CODE_EXAMPLE_2_HTML;

// example state
buttonTypeIsOutlined = true;
counter1 = 0;
counter2 = 0;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
import { HighlightModule } from 'ngx-highlightjs';
import { FormsModule } from '@angular/forms';

import {
LazyElementModuleOptions,
Expand All @@ -26,6 +27,7 @@ const options: LazyElementModuleOptions = {
declarations: [DynamicComponent],
imports: [
HighlightModule,
FormsModule,
LazyElementsModule.forFeature(options),
SharedModule,
DynamicRoutingModule
Expand Down
6 changes: 4 additions & 2 deletions projects/elements-demo/src/app/shared/shared.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ import {
MatExpansionModule,
MatSnackBarModule,
MatSliderModule,
MatFormFieldModule
MatFormFieldModule,
MatSlideToggleModule
} from '@angular/material';
import { SpinnerComponent } from './spinner/spinner.component';
import { ErrorComponent } from './error/error.component';
Expand All @@ -32,7 +33,8 @@ const ANGULAR_MATERIAL_MODULES = [
MatExpansionModule,
MatSnackBarModule,
MatSliderModule,
MatFormFieldModule
MatFormFieldModule,
MatSlideToggleModule
];

@NgModule({
Expand Down

0 comments on commit 49e211f

Please sign in to comment.