Skip to content

Commit e40b4f5

Browse files
committed
feat(ngx-material-pages): added page content component
1 parent 72186c8 commit e40b4f5

4 files changed

Lines changed: 57 additions & 0 deletions

File tree

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<ng-template>
2+
<mat-card>
3+
<mat-card-title>{{title}}</mat-card-title>
4+
<mat-card-content>
5+
<ng-content></ng-content>
6+
</mat-card-content>
7+
</mat-card>
8+
</ng-template>

src/module/ngx-material-pages/ngx-material-page-content/ngx-material-page-content.component.scss

Whitespace-only changes.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
2+
3+
import { NgxMaterialPageContentComponent } from './ngx-material-page-content.component';
4+
5+
describe('NgxMaterialPageContentComponent', () => {
6+
let component: NgxMaterialPageContentComponent;
7+
let fixture: ComponentFixture<NgxMaterialPageContentComponent>;
8+
9+
beforeEach(async(() => {
10+
TestBed.configureTestingModule({
11+
declarations: [ NgxMaterialPageContentComponent ]
12+
})
13+
.compileComponents();
14+
}));
15+
16+
beforeEach(() => {
17+
fixture = TestBed.createComponent(NgxMaterialPageContentComponent);
18+
component = fixture.componentInstance;
19+
fixture.detectChanges();
20+
});
21+
22+
it('should create', () => {
23+
expect(component).toBeTruthy();
24+
});
25+
});
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import {ChangeDetectionStrategy, Component, Input, OnInit, TemplateRef, ViewChild, ViewEncapsulation} from '@angular/core';
2+
3+
@Component({
4+
selector: 'ngx-material-page-content',
5+
templateUrl: './ngx-material-page-content.component.html',
6+
styleUrls: ['./ngx-material-page-content.component.scss'],
7+
encapsulation: ViewEncapsulation.None,
8+
changeDetection: ChangeDetectionStrategy.OnPush,
9+
})
10+
export class NgxMaterialPageContentComponent implements OnInit {
11+
12+
/** Template for page content. */
13+
@ViewChild(TemplateRef) content: TemplateRef<any>;
14+
15+
@Input()
16+
title: string;
17+
18+
constructor() {
19+
}
20+
21+
ngOnInit() {
22+
}
23+
24+
}

0 commit comments

Comments
 (0)