Skip to content

Commit

Permalink
feat(ngx-material-pages): added the main ngx-material-pages component
Browse files Browse the repository at this point in the history
  • Loading branch information
AnthonyNahas committed Apr 9, 2018
1 parent 7bb6be4 commit 509ff32
Show file tree
Hide file tree
Showing 4 changed files with 124 additions and 0 deletions.
65 changes: 65 additions & 0 deletions src/module/ngx-material-pages/ngx-material-pages.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<mat-sidenav-container>
<mat-sidenav #start [mode]="'side'" opened="true"
[fixedInViewport]="'false'" [fixedTopGap]="'false'" [fixedBottomGap]="'false'">

<mat-toolbar color="primary">
</mat-toolbar>

<mat-vertical-stepper>
<mat-step *ngFor="let page of pages;let i = index;">
<ng-container [ngTemplateOutlet]="page.pagesOutlook.content"></ng-container>
</mat-step>
</mat-vertical-stepper>
</mat-sidenav>

<mat-sidenav-content>
<mat-toolbar color="primary">
<button mat-icon-button>
<mat-icon>menu</mat-icon>
</button>
ngx-auth-firebaseui - npm install
</mat-toolbar>
<div class="demo-sidenav-content main-container">

<mat-tab-group [selectedIndex]="index" style="height: 80vh;">
<button mat-fab color="warn" (click)="previous()">
<mat-icon>location</mat-icon>
</button>
<mat-tab style="background: blue; margin: 2rem;">
<mat-card style="background: red; margin: 5rem; height: 1300px">
<mat-card-title>
Title1
</mat-card-title>
<mat-card-content>
<h2>test</h2>
</mat-card-content>
</mat-card>
</mat-tab>
<!--<mat-tab>-->
<!--<step-content>-->
<!--<mat-card style="background: yellow; margin: 5rem; height: 700px">-->
<!--<mat-card-title>-->
<!--Title2-->
<!--</mat-card-title>-->
<!--<mat-card-content>-->
<!--<h2>test</h2>-->
<!--</mat-card-content>-->
<!--</mat-card>-->
<!--</step-content>-->
<!--</mat-tab>-->
</mat-tab-group>


<div fxLayoutAlign="space-between" style="margin: 1rem">
<button mat-fab color="primary" (click)="previous()">
<mat-icon>chevron_left</mat-icon>
</button>
<button mat-fab color="primary" (click)="next()">
<mat-icon>chevron_right</mat-icon>
</button>
</div>

<!--<button mat-button (click)="start.toggle(undefined, 'mouse')">Toggle Start Side Sidenav</button>-->
</div>
</mat-sidenav-content>
</mat-sidenav-container>
Empty file.
25 changes: 25 additions & 0 deletions src/module/ngx-material-pages/ngx-material-pages.component.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';

import { NgxMaterialPagesComponent } from './ngx-material-pages.component';

describe('NgxMaterialPagesComponent', () => {
let component: NgxMaterialPagesComponent;
let fixture: ComponentFixture<NgxMaterialPagesComponent>;

beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ NgxMaterialPagesComponent ]
})
.compileComponents();
}));

beforeEach(() => {
fixture = TestBed.createComponent(NgxMaterialPagesComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
34 changes: 34 additions & 0 deletions src/module/ngx-material-pages/ngx-material-pages.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import {
AfterContentInit,
ChangeDetectionStrategy,
Component,
ContentChildren,
forwardRef,
OnInit,
QueryList,
ViewEncapsulation
} from '@angular/core';
import {NgxMaterialPageLoaderComponent} from './ngx-material-page-loader/ngx-material-page-loader.component';

@Component({
selector: 'ngx-material-pages',
templateUrl: './ngx-material-pages.component.html',
styleUrls: ['./ngx-material-pages.component.scss'],
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class NgxMaterialPagesComponent implements OnInit, AfterContentInit {

@ContentChildren(NgxMaterialPageLoaderComponent) pages: QueryList<NgxMaterialPageLoaderComponent>;

constructor() {
}

ngOnInit() {
}

ngAfterContentInit() {
console.log('pagesOutlook', this.pages);
}

}

0 comments on commit 509ff32

Please sign in to comment.