mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-08-07 17:48:54 +00:00
Support for column (cell) templates (#1513)
support for column (cell) templates readme updates and test fixes
This commit is contained in:
committed by
Eugenio Romano
parent
bf5482bf7b
commit
eacdfd7f6a
@@ -35,7 +35,7 @@ describe('ContentColumn', () => {
|
||||
spyOn(columnList, 'registerColumn').and.callThrough();
|
||||
|
||||
let column = new ContentColumnComponent(columnList);
|
||||
column.ngOnInit();
|
||||
column.ngAfterContentInit();
|
||||
|
||||
expect(columnList.registerColumn).toHaveBeenCalled();
|
||||
|
||||
@@ -56,7 +56,7 @@ describe('ContentColumn', () => {
|
||||
let column = new ContentColumnComponent(columnList);
|
||||
spyOn(column, 'register').and.callThrough();
|
||||
|
||||
column.ngOnInit();
|
||||
column.ngAfterContentInit();
|
||||
expect(column.register).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Component, OnInit, Input } from '@angular/core';
|
||||
import { Component, OnInit, Input, ContentChild, TemplateRef, AfterContentInit } from '@angular/core';
|
||||
import { DataColumn } from 'ng2-alfresco-datatable';
|
||||
|
||||
import { ContentColumnListComponent } from './content-column-list.component';
|
||||
@@ -24,7 +24,7 @@ import { ContentColumnListComponent } from './content-column-list.component';
|
||||
selector: 'content-column',
|
||||
template: ''
|
||||
})
|
||||
export class ContentColumnComponent implements OnInit, DataColumn {
|
||||
export class ContentColumnComponent implements OnInit, AfterContentInit, DataColumn {
|
||||
|
||||
@Input()
|
||||
key: string;
|
||||
@@ -41,6 +41,9 @@ export class ContentColumnComponent implements OnInit, DataColumn {
|
||||
@Input()
|
||||
title: string = '';
|
||||
|
||||
@ContentChild(TemplateRef)
|
||||
template: any;
|
||||
|
||||
/**
|
||||
* Title to be used for screen readers.
|
||||
*/
|
||||
@@ -56,7 +59,9 @@ export class ContentColumnComponent implements OnInit, DataColumn {
|
||||
if (!this.srTitle && this.key === '$thumbnail') {
|
||||
this.srTitle = 'Thumbnail';
|
||||
}
|
||||
}
|
||||
|
||||
ngAfterContentInit() {
|
||||
this.register();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user