Skip to content

Commit

Permalink
feat(ngx-material-pages): added page content component
Browse files Browse the repository at this point in the history
  • Loading branch information
AnthonyNahas committed Apr 9, 2018
1 parent 72186c8 commit e40b4f5
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<ng-template>
<mat-card>
<mat-card-title>{{title}}</mat-card-title>
<mat-card-content>
<ng-content></ng-content>
</mat-card-content>
</mat-card>
</ng-template>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';

import { NgxMaterialPageContentComponent } from './ngx-material-page-content.component';

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

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

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

it('should create', () => {
expect(component).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import {ChangeDetectionStrategy, Component, Input, OnInit, TemplateRef, ViewChild, ViewEncapsulation} from '@angular/core';

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

/** Template for page content. */
@ViewChild(TemplateRef) content: TemplateRef<any>;

@Input()
title: string;

constructor() {
}

ngOnInit() {
}

}

0 comments on commit e40b4f5

Please sign in to comment.