mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
Performance improvements (#1166)
#1166 * Update angular libs document-list: performance improvements caching ‘heavy’ cell evaluations (i.e. date pipe) code/test fixes document-list: performance improvements Removed ‘AfterViewChecked’ bottleneck as underlying data-table already does it. data-table: performance improvements
This commit is contained in:
committed by
Eugenio Romano
parent
0f563e38bb
commit
3ca2c28a41
@@ -172,13 +172,13 @@ describe('DataTable', () => {
|
||||
let handler = jasmine.createSpyObj('componentHandler', ['upgradeAllRegistered']);
|
||||
window['componentHandler'] = handler;
|
||||
|
||||
dataTable.ngAfterViewChecked();
|
||||
dataTable.ngOnInit();
|
||||
expect(handler.upgradeAllRegistered).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('should upgrade MDL components only when component handler present', () => {
|
||||
expect(window['componentHandler']).toBeNull();
|
||||
dataTable.ngAfterViewChecked();
|
||||
dataTable.ngOnInit();
|
||||
});
|
||||
|
||||
it('should invert "select all" status', () => {
|
||||
|
@@ -15,16 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {
|
||||
Component,
|
||||
OnInit,
|
||||
Input,
|
||||
Output,
|
||||
EventEmitter,
|
||||
AfterViewChecked,
|
||||
TemplateRef
|
||||
} from '@angular/core';
|
||||
|
||||
import { Component, OnInit, Input, Output, EventEmitter, TemplateRef } from '@angular/core';
|
||||
import {
|
||||
DataTableAdapter,
|
||||
DataRow,
|
||||
@@ -42,7 +33,7 @@ declare var componentHandler;
|
||||
styleUrls: ['./datatable.component.css'],
|
||||
templateUrl: './datatable.component.html'
|
||||
})
|
||||
export class DataTableComponent implements OnInit, AfterViewChecked {
|
||||
export class DataTableComponent implements OnInit {
|
||||
|
||||
@Input()
|
||||
data: DataTableAdapter;
|
||||
@@ -79,9 +70,7 @@ export class DataTableComponent implements OnInit, AfterViewChecked {
|
||||
if (!this.data) {
|
||||
this.data = new ObjectDataTableAdapter([], []);
|
||||
}
|
||||
}
|
||||
|
||||
ngAfterViewChecked() {
|
||||
// workaround for MDL issues with dynamic components
|
||||
if (componentHandler) {
|
||||
componentHandler.upgradeAllRegistered();
|
||||
|
Reference in New Issue
Block a user