-
Notifications
You must be signed in to change notification settings - Fork 915
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(examples): add elements example
- minor styling fixes
- Loading branch information
1 parent
6eb1651
commit 9e238c3
Showing
13 changed files
with
218 additions
and
35 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.main-heading { | ||
text-transform: uppercase; | ||
margin: 0 0 20px 0; | ||
} |
54 changes: 54 additions & 0 deletions
54
.../angular-ngrx-material-starter/src/app/features/examples/elements/elements.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<div class="container"> | ||
<div class="row"> | ||
<div class="col-md-12"> | ||
<h1 class="main-heading"> | ||
{{ 'anms.examples.elements.title' | translate }} | ||
</h1> | ||
</div> | ||
</div> | ||
<div class="row" [ngClass]="routeAnimationsElements" rtl> | ||
<div class="col-md-12 col-lg-6"> | ||
<ng-template #loading>Loading...</ng-template> | ||
<mwc-button raised *axLazyElement="'https://unpkg.com/@material/[email protected]/mwc-button.js?module'; loadingTemplate: loading; module: true" | ||
(click)="increment()"> | ||
Increment | ||
</mwc-button> | ||
<br> | ||
<br> | ||
<p>{{ 'anms.examples.elements.counter' | translate }}: {{counter}}</p> | ||
</div> | ||
<div class="col-md-12 col-lg-6" [ngClass]="routeAnimationsElements"> | ||
<p> | ||
{{ 'anms.examples.elements.text1' | translate }} | ||
<code>https://unpkg.com/@material/[email protected]/mwc-button.js?module</code> | ||
{{ 'anms.examples.elements.text2' | translate }} | ||
</p> | ||
<p> | ||
{{ 'anms.examples.elements.text3' | translate }} | ||
<code>*axLazyElement</code> | ||
{{ 'anms.examples.elements.text4' | translate }} | ||
<code>@angular-extensions/elements</code> | ||
{{ 'anms.examples.elements.text5' | translate }}. | ||
</p> | ||
<p> | ||
{{ 'anms.examples.elements.text6' | translate }} | ||
<a href="https://github.com/angular-extensions/elements" target="_blank">{{ | ||
'anms.examples.elements.text5' | translate | ||
}}</a>, | ||
<a href="https://angular-extensions.github.io/elements/#/docs/use-cases" target="_blank">{{ | ||
'anms.examples.elements.text7' | translate | ||
}}</a> | ||
{{ 'anms.examples.elements.text8' | translate }} | ||
{{ 'anms.examples.elements.text9' | translate }} | ||
<a href="https://angular-extensions.github.io/elements/#/examples" target="_blank">{{ | ||
'anms.examples.elements.text10' | translate | ||
}}</a> | ||
|
||
{{ 'anms.examples.elements.text11' | translate }} | ||
<a href="https://angular-extensions.github.io/elements/#/docs" target="_blank">{{ | ||
'anms.examples.elements.text12' | translate | ||
}}</a>... | ||
</p> | ||
</div> | ||
</div> | ||
</div> |
4 changes: 4 additions & 0 deletions
4
.../angular-ngrx-material-starter/src/app/features/examples/elements/elements.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.main-heading { | ||
text-transform: uppercase; | ||
margin: 0 0 20px 0; | ||
} |
37 changes: 37 additions & 0 deletions
37
...gular-ngrx-material-starter/src/app/features/examples/elements/elements.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
import { NoopAnimationsModule } from '@angular/platform-browser/animations'; | ||
import { LazyElementsModule } from '@angular-extensions/elements'; | ||
import { TranslateModule } from '@ngx-translate/core'; | ||
|
||
import { SharedModule } from '../../../shared/shared.module'; | ||
|
||
import { ElementsComponent } from './elements.component'; | ||
|
||
describe('ElementsComponent', () => { | ||
let component: ElementsComponent; | ||
let fixture: ComponentFixture<ElementsComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
schemas: [CUSTOM_ELEMENTS_SCHEMA], | ||
imports: [ | ||
SharedModule, | ||
NoopAnimationsModule, | ||
TranslateModule.forRoot(), | ||
LazyElementsModule | ||
], | ||
declarations: [ElementsComponent] | ||
}).compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(ElementsComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
23 changes: 23 additions & 0 deletions
23
...ts/angular-ngrx-material-starter/src/app/features/examples/elements/elements.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core'; | ||
|
||
import { ROUTE_ANIMATIONS_ELEMENTS } from '../../../core/animations/route.animations'; | ||
|
||
@Component({ | ||
selector: 'anms-elements', | ||
templateUrl: './elements.component.html', | ||
styleUrls: ['./elements.component.scss'], | ||
changeDetection: ChangeDetectionStrategy.OnPush | ||
}) | ||
export class ElementsComponent implements OnInit { | ||
routeAnimationsElements = ROUTE_ANIMATIONS_ELEMENTS; | ||
|
||
counter = 0; | ||
|
||
constructor() {} | ||
|
||
ngOnInit() {} | ||
|
||
increment() { | ||
this.counter++; | ||
} | ||
} |
Oops, something went wrong.