Skip to content

Commit 17e3775

Browse files
committed
Material stepper added and updated docs
1 parent e108cd7 commit 17e3775

File tree

8 files changed

+92
-24
lines changed

8 files changed

+92
-24
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
![logo](https://jerouw.nl/wp-content/uploads/2017/05/ngfbmd.png "Logo")
1010

1111
# Angular 4 | Material Design | Firebase - Starter kit
12-
A full stack starter app containing [Angular 4](https://angular.io) (v4.4.3), [Material](https://material.io/) (v2.0.0-beta.8) and [Firebase](https://firebase.google.com/) (v4.4.0).
12+
A full stack starter app containing [Angular 4](https://angular.io) (v4.4.5), [Material](https://material.io/) (v2.0.0-beta.12) and [Firebase](https://firebase.google.com/) (v4.5.1).
1313

1414
## [Live demo](http://angular4.jerouw.nl)
1515
![loginpage](https://jerouw.nl/wp-content/uploads/2017/05/ngfbmdprintscreen.png "Logo")

docs/FEATURES.md

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,19 @@
2424
* Loading spinner and progress bar
2525

2626
## Material Design usage in this project:
27-
* MD Datepicker
28-
* MD Input
29-
* MD Slide toggle
30-
* MD Menu
31-
* MD Sidenav
32-
* MD Toolbar
33-
* MD Table
34-
* MD Card
35-
* MD Tabs
36-
* MD Buttons
37-
* MD Icon
38-
* MD Progress spinner
39-
* MD Progress bar
40-
* MD Tooltip
41-
* MD Snackbar
27+
* Mat Datepicker
28+
* Mat Input
29+
* Mat Slide toggle
30+
* Mat Menu
31+
* Mat Sidenav
32+
* Mat Toolbar
33+
* Mat Table
34+
* Mat Stepper
35+
* Mat Card
36+
* Mat Tabs
37+
* Mat Buttons
38+
* Mat Icon
39+
* Mat Progress spinner
40+
* Mat Progress bar
41+
* Mat Tooltip
42+
* Mat Snackbar

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ngxmatfire",
3-
"version": "1.0.6",
3+
"version": "1.0.7",
44
"author": "Jeroen Ouwehand",
55
"description": "Full stack starter app with Angular 4, Material Design and Firebase.",
66
"keywords": [

src/app/components/misc/misc.component.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ <h3>mat Slide toggle : </h3>
5353
Click me!
5454
</mat-slide-toggle>
5555

56-
<br/><hr>
56+
<br/><hr><br/>
57+
58+
<app-stepper></app-stepper>
5759

5860
<!-- Temporary disabled -->
5961
<!-- <app-table></app-table> -->

src/app/components/misc/misc.module.ts

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import { NgModule } from '@angular/core';
22
import { CommonModule } from '@angular/common';
33

4-
import { MatButtonModule, MatCheckboxModule, MatInputModule, MatNativeDateModule, MatSlideToggleModule,
5-
MatTooltipModule, MatSidenavModule, MatTableModule, MatCardModule, MatDatepickerModule } from '@angular/material';
4+
import { MatButtonModule, MatCheckboxModule, MatInputModule, MatNativeDateModule,
5+
MatSlideToggleModule, MatStepperModule, MatTooltipModule, MatSidenavModule,
6+
MatTableModule, MatCardModule, MatDatepickerModule } from '@angular/material';
67

78
// import { CdkTableModule } from '@angular/cdk';
89
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
@@ -16,6 +17,7 @@ import { ChangeDetectionComponent } from './change/change-detection.component';
1617
import { ChangeDetailComponent } from './change/change-detail.component';
1718
import { VirtRealComponent } from './virtual-reality/virtreal.component';
1819
import { TableComponent } from './table/table.component';
20+
import { StepperComponent } from './stepper/stepper.component';
1921

2022
@NgModule({
2123
declarations: [
@@ -24,12 +26,14 @@ import { TableComponent } from './table/table.component';
2426
ChangeDetectionComponent,
2527
ChangeDetailComponent,
2628
VirtRealComponent,
27-
TableComponent
29+
TableComponent,
30+
StepperComponent
2831
],
2932
imports: [
3033
CommonModule,
31-
MatButtonModule, MatCheckboxModule, MatInputModule, MatNativeDateModule, MatSlideToggleModule,
32-
MatTooltipModule, MatSidenavModule, MatTableModule, MatCardModule, MatDatepickerModule,
34+
MatButtonModule, MatCheckboxModule, MatInputModule, MatNativeDateModule,
35+
MatSlideToggleModule, MatStepperModule, MatTooltipModule, MatSidenavModule,
36+
MatTableModule, MatCardModule, MatDatepickerModule,
3337
FormsModule, ReactiveFormsModule,
3438
PipesModule,
3539
// MiscRoutingModule
@@ -40,7 +44,8 @@ import { TableComponent } from './table/table.component';
4044
ChangeDetectionComponent,
4145
ChangeDetailComponent,
4246
VirtRealComponent,
43-
TableComponent
47+
TableComponent,
48+
StepperComponent
4449
]
4550
})
4651

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<button mat-raised-button (click)="isLinear = true" id="toggle-linear">Enable linear mode</button>
2+
3+
<mat-horizontal-stepper [linear]="isLinear">
4+
<mat-step [stepControl]="firstFormGroup">
5+
<form [formGroup]="firstFormGroup">
6+
<ng-template matStepLabel>Fill out your name</ng-template>
7+
<mat-form-field>
8+
<input matInput placeholder="First name and last name" formControlName="name" required>
9+
</mat-form-field>
10+
<div>
11+
<button mat-button matStepperNext>Next</button>
12+
</div>
13+
</form>
14+
</mat-step>
15+
<mat-step [stepControl]="secondFormGroup">
16+
<form [formGroup]="secondFormGroup">
17+
<ng-template matStepLabel>Fill out your email</ng-template>
18+
<mat-form-field>
19+
<input matInput placeholder="Email" formControlName="email" required>
20+
</mat-form-field>
21+
<div>
22+
<button mat-button matStepperPrevious>Back</button>
23+
<button mat-button matStepperNext [disabled]="secondFormGroup.invalid">Next</button>
24+
</div>
25+
</form>
26+
</mat-step>
27+
<mat-step>
28+
<ng-template matStepLabel>Done</ng-template>
29+
You are now done.
30+
<div>
31+
<button mat-button matStepperPrevious>Back</button>
32+
</div>
33+
</mat-step>
34+
</mat-horizontal-stepper>

src/app/components/misc/stepper/stepper.component.scss

Whitespace-only changes.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { Component, OnInit } from '@angular/core';
2+
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
3+
4+
import { EmailValidator } from '../../shared';
5+
6+
@Component({
7+
selector: 'app-stepper',
8+
templateUrl: './stepper.component.html',
9+
styleUrls: ['./stepper.component.scss']
10+
})
11+
export class StepperComponent implements OnInit {
12+
isLinear = false;
13+
firstFormGroup: FormGroup;
14+
secondFormGroup: FormGroup;
15+
16+
constructor(private _formBuilder: FormBuilder) { }
17+
18+
ngOnInit() {
19+
this.firstFormGroup = this._formBuilder.group({
20+
name: ['', Validators.required]
21+
});
22+
this.secondFormGroup = this._formBuilder.group({
23+
email: ['', Validators.compose([Validators.required, EmailValidator.isValid])]
24+
});
25+
}
26+
}

0 commit comments

Comments
 (0)