-
-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(demo): added examples module to explore the library
- Loading branch information
1 parent
1e38cea
commit 3a86a5a
Showing
17 changed files
with
349 additions
and
42 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,20 +1,24 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { Routes, RouterModule } from '@angular/router'; | ||
import {NgModule} from '@angular/core'; | ||
import {Routes, RouterModule} from '@angular/router'; | ||
|
||
const routes: Routes = [ | ||
{ | ||
path: '', | ||
redirectTo: 'home', | ||
pathMatch: 'full' | ||
}, | ||
{ | ||
path: 'getting-started', | ||
loadChildren: 'app/getting-started/getting-started.module#GettingStartedModule' | ||
} | ||
]; | ||
{ | ||
path: '', | ||
redirectTo: 'home', | ||
pathMatch: 'full' | ||
}, | ||
{ | ||
path: 'getting-started', | ||
loadChildren: 'app/getting-started/getting-started.module#GettingStartedModule' | ||
}, | ||
{ | ||
path: 'examples', | ||
loadChildren: 'app/examples/examples.module#ExamplesModule' | ||
}]; | ||
|
||
@NgModule({ | ||
imports: [RouterModule.forRoot(routes)], | ||
exports: [RouterModule] | ||
imports: [RouterModule.forRoot(routes)], | ||
exports: [RouterModule] | ||
}) | ||
export class AppRoutingModule { } | ||
export class AppRoutingModule { | ||
} |
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,12 @@ | ||
import {RouterModule} from '@angular/router'; | ||
import {NgModule} from '@angular/core'; | ||
import {ExamplesComponent} from './examples.component'; | ||
|
||
@NgModule({ | ||
imports: [RouterModule.forChild([ | ||
{path: '', component: ExamplesComponent} | ||
])], | ||
exports: [RouterModule] | ||
}) | ||
export class ExamplesRoutingModule { | ||
} |
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,178 @@ | ||
<div class="jumbotron jumbotron-fluid"> | ||
<div class="container"> | ||
<h1>Explore the library and try these examples <3</h1> | ||
</div> | ||
</div> | ||
|
||
<section class="home"> | ||
<div class="container"> | ||
|
||
<mat-card> | ||
<mat-card-title>#1</mat-card-title> | ||
<mat-card-subtitle>stand alone password component, digit char is optional</mat-card-subtitle> | ||
|
||
<mat-slide-toggle #toggle1>Show Password Details</mat-slide-toggle> | ||
|
||
<mat-card-content> | ||
<!--password input filed--> | ||
<mat-form-field appearance="outline" style="width: 100%" [color]="passwordComponent1.color"> | ||
<mat-label>Password</mat-label> | ||
<input matInput #password | ||
type="password" | ||
placeholder="Password"> | ||
<mat-hint align="end" aria-live="polite"> | ||
{{password.value.length}} / {{passwordComponent1.max}} | ||
</mat-hint> | ||
</mat-form-field> | ||
|
||
<!--@angular-material-extensions/password-strength's main component--> | ||
<mat-password-strength #passwordComponent1 | ||
[enableDigitRule]="false" | ||
(onStrengthChanged)="onStrengthChanged($event)" | ||
[password]="password.value"> | ||
</mat-password-strength> | ||
<!--Password's strength info--> | ||
<mat-password-strength-info | ||
*ngIf="toggle1.checked" | ||
[passwordComponent]="passwordComponent1"> | ||
</mat-password-strength-info> | ||
</mat-card-content> | ||
|
||
<mat-card class="mt-2"> | ||
<mat-card-title>code</mat-card-title> | ||
<mat-card-content> | ||
<markdown src="assets/md/examples/e1.md"></markdown> | ||
</mat-card-content> | ||
</mat-card> | ||
</mat-card> | ||
|
||
|
||
<!-- #2 --> | ||
<mat-card class="mt-4"> | ||
<mat-card-title>#2</mat-card-title> | ||
<mat-card-subtitle>stand alone password component, special char and lower case are optional</mat-card-subtitle> | ||
|
||
<mat-slide-toggle #toggle2>Show Password Details</mat-slide-toggle> | ||
|
||
<mat-card-content> | ||
<!--password input filed--> | ||
<mat-form-field appearance="outline" style="width: 100%" [color]="passwordComponent2.color"> | ||
<mat-label>Password</mat-label> | ||
<input matInput #password2 | ||
type="password" | ||
placeholder="Password"> | ||
<mat-hint align="end" aria-live="polite"> | ||
{{password2.value.length}} / {{passwordComponent2.max}} | ||
</mat-hint> | ||
</mat-form-field> | ||
|
||
<!--@angular-material-extensions/password-strength's main component--> | ||
<mat-password-strength #passwordComponent2 | ||
[enableLowerCaseLetterRule]="false" | ||
[enableSpecialCharRule]="false" | ||
(onStrengthChanged)="onStrengthChanged($event)" | ||
[password]="password2.value"> | ||
</mat-password-strength> | ||
<!--Password's strength info--> | ||
<mat-password-strength-info | ||
*ngIf="toggle2.checked" | ||
[passwordComponent]="passwordComponent2"> | ||
</mat-password-strength-info> | ||
</mat-card-content> | ||
|
||
<mat-card class="mt-2"> | ||
<mat-card-title>code</mat-card-title> | ||
<mat-card-content> | ||
<markdown src="assets/md/examples/e2.md"></markdown> | ||
</mat-card-content> | ||
</mat-card> | ||
</mat-card> | ||
|
||
<!-- #3 --> | ||
<mat-card class="mt-4"> | ||
<mat-card-title>#3</mat-card-title> | ||
<mat-card-subtitle>stand alone password component, the length of the password and an upper case char are | ||
optional | ||
</mat-card-subtitle> | ||
|
||
<mat-slide-toggle #toggle3>Show Password Details</mat-slide-toggle> | ||
|
||
<mat-card-content> | ||
<!--password input filed--> | ||
<mat-form-field appearance="outline" style="width: 100%" [color]="passwordComponent3.color"> | ||
<mat-label>Password</mat-label> | ||
<input matInput #password3 | ||
type="password" | ||
placeholder="Password"> | ||
<mat-hint align="end" aria-live="polite"> | ||
{{password3.value.length}} / {{passwordComponent3.max}} | ||
</mat-hint> | ||
</mat-form-field> | ||
|
||
<!--@angular-material-extensions/password-strength's main component--> | ||
<mat-password-strength #passwordComponent3 | ||
[enableLengthRule]="false" | ||
[enableUpperCaseLetterRule]="false" | ||
(onStrengthChanged)="onStrengthChanged($event)" | ||
[password]="password3.value"> | ||
</mat-password-strength> | ||
<!--Password's strength info--> | ||
<mat-password-strength-info | ||
*ngIf="toggle3.checked" | ||
[passwordComponent]="passwordComponent3"> | ||
</mat-password-strength-info> | ||
</mat-card-content> | ||
|
||
<mat-card class="mt-2"> | ||
<mat-card-title>code</mat-card-title> | ||
<mat-card-content> | ||
<markdown src="assets/md/examples/e3.md"></markdown> | ||
</mat-card-content> | ||
</mat-card> | ||
</mat-card> | ||
|
||
<!-- #4 --> | ||
<mat-card class="mt-4"> | ||
<mat-card-title>#4</mat-card-title> | ||
<mat-card-subtitle>stand alone password component, min length = 6 and the max is = 12 | ||
optional | ||
</mat-card-subtitle> | ||
|
||
<mat-slide-toggle #toggle4>Show Password Details</mat-slide-toggle> | ||
|
||
<mat-card-content> | ||
<!--password input filed--> | ||
<mat-form-field appearance="outline" style="width: 100%" [color]="passwordComponent4.color"> | ||
<mat-label>Password</mat-label> | ||
<input matInput #password4 | ||
type="password" | ||
placeholder="Password"> | ||
<mat-hint align="end" aria-live="polite"> | ||
{{password4.value.length}} / {{passwordComponent4.max}} | ||
</mat-hint> | ||
</mat-form-field> | ||
|
||
<!--@angular-material-extensions/password-strength's main component--> | ||
<mat-password-strength #passwordComponent4 | ||
[min]="6" | ||
[max]="12" | ||
(onStrengthChanged)="onStrengthChanged($event)" | ||
[password]="password4.value"> | ||
</mat-password-strength> | ||
<!--Password's strength info--> | ||
<mat-password-strength-info | ||
*ngIf="toggle4.checked" | ||
[passwordComponent]="passwordComponent4"> | ||
</mat-password-strength-info> | ||
</mat-card-content> | ||
|
||
<mat-card class="mt-2"> | ||
<mat-card-title>code</mat-card-title> | ||
<mat-card-content> | ||
<markdown src="assets/md/examples/e4.md"></markdown> | ||
</mat-card-content> | ||
</mat-card> | ||
</mat-card> | ||
|
||
</div> | ||
</section> |
Empty file.
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,25 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { ExamplesComponent } from './examples.component'; | ||
|
||
describe('ExampleComponent', () => { | ||
let component: ExamplesComponent; | ||
let fixture: ComponentFixture<ExamplesComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [ ExamplesComponent ] | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(ExamplesComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
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,20 @@ | ||
import {Component, OnInit} from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'app-example', | ||
templateUrl: './examples.component.html', | ||
styleUrls: ['./examples.component.scss'] | ||
}) | ||
export class ExamplesComponent implements OnInit { | ||
|
||
constructor() { | ||
} | ||
|
||
ngOnInit() { | ||
} | ||
|
||
onStrengthChanged(strength: number) { | ||
console.log('password strength = ', strength); | ||
} | ||
|
||
} |
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,13 @@ | ||
import { ExamplesModule } from './examples.module'; | ||
|
||
describe('ExamplesModule', () => { | ||
let exampleModule: ExamplesModule; | ||
|
||
beforeEach(() => { | ||
exampleModule = new ExamplesModule(); | ||
}); | ||
|
||
it('should create an instance', () => { | ||
expect(exampleModule).toBeTruthy(); | ||
}); | ||
}); |
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,18 @@ | ||
import {NgModule} from '@angular/core'; | ||
import {CommonModule} from '@angular/common'; | ||
import {ExamplesComponent} from './examples.component'; | ||
import {ExamplesRoutingModule} from './examples-routing.module'; | ||
import {AppSharedModule} from '../shared'; | ||
import {MarkdownModule} from 'ngx-markdown'; | ||
|
||
@NgModule({ | ||
imports: [ | ||
CommonModule, | ||
MarkdownModule.forChild(), | ||
ExamplesRoutingModule, | ||
AppSharedModule | ||
], | ||
declarations: [ExamplesComponent] | ||
}) | ||
export class ExamplesModule { | ||
} |
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 |
---|---|---|
@@ -1,11 +1,12 @@ | ||
import { RouterModule } from '@angular/router'; | ||
import { NgModule } from '@angular/core'; | ||
import { HomeComponent } from './home.component'; | ||
import {RouterModule} from '@angular/router'; | ||
import {NgModule} from '@angular/core'; | ||
import {HomeComponent} from './home.component'; | ||
|
||
@NgModule({ | ||
imports: [RouterModule.forChild([ | ||
{ path: 'home', component: HomeComponent } | ||
])], | ||
exports: [RouterModule] | ||
}) | ||
export class HomeRoutingModule {} | ||
imports: [RouterModule.forChild([ | ||
{path: 'home', component: HomeComponent} | ||
])], | ||
exports: [RouterModule] | ||
}) | ||
export class HomeRoutingModule { | ||
} |
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
Oops, something went wrong.