Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 16 additions & 6 deletions src/app/shared/component/smd-datatable/datatable.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import {
ViewEncapsulation,
Input,
Output,
Inject,
forwardRef,
Injector,
EventEmitter,
DoCheck,
IterableDiffers,
Expand Down Expand Up @@ -131,11 +130,14 @@ export class SmdDataTableCellComponent implements OnInit, OnDestroy {
`
})
export class SmdDataTableRowComponent {
private _parent: SmdDataTable;

@Input() row: SmdDataRowModel;
@Input() renderCheckbox: boolean;
@Input() columns: SmdDataTableColumnComponent[];

constructor(@Inject(forwardRef(() => SmdDataTable)) private _parent: SmdDataTable, private dialog: MdDialog, private viewContainerRef: ViewContainerRef) {
constructor(injector: Injector, private dialog: MdDialog, private viewContainerRef: ViewContainerRef) {
this._parent = injector.get(SmdDataTable);
}

_onClick(column: SmdDataTableColumnComponent, model: any) {
Expand Down Expand Up @@ -234,10 +236,13 @@ export class SmdDataTableColumnComponent implements OnInit {
`
})
export class SmdDatatableActionButton {
private _parent: SmdDataTable;

@Input() label: string;
@Output() onClick: EventEmitter<void> = new EventEmitter<void>();

constructor(@Inject(forwardRef(() => SmdDataTable)) private _parent: SmdDataTable) {
constructor(injector: Injector) {
this._parent = injector.get(SmdDataTable);
}

_onButtonClick(event: Event) {
Expand All @@ -260,12 +265,15 @@ export class SmdDatatableActionButton {
`
})
export class SmdContextualDatatableButton {
private _parent: SmdDataTable;

@Input() icon: string;
@Input() minimunSelected: number = -1;
@Input() maxSelected: number = -1;
@Output() onClick: EventEmitter<any[]> = new EventEmitter<any[]>();

constructor(@Inject(forwardRef(() => SmdDataTable)) private _parent: SmdDataTable) {
constructor(injector: Injector) {
this._parent = injector.get(SmdDataTable);
}

_onButtonClick(event: Event) {
Expand Down Expand Up @@ -308,6 +316,7 @@ export class SmdContextualDatatableButton {
}
})
export class SmdDatatableHeader implements AfterContentInit, OnDestroy {
private _parent: SmdDataTable;

private filterTimeout: any;
public filterValue: string;
Expand All @@ -320,7 +329,8 @@ export class SmdDatatableHeader implements AfterContentInit, OnDestroy {
@ContentChildren(SmdDatatableActionButton) actionButtons: QueryList<SmdDatatableActionButton>;
@ContentChildren(SmdContextualDatatableButton) contextualButtons: QueryList<SmdContextualDatatableButton>;

constructor(@Inject(forwardRef(() => SmdDataTable)) private _parent: SmdDataTable) {
constructor(injector: Injector) {
this._parent = injector.get(SmdDataTable);
}

public shouldRenderCheckbox() {
Expand Down
11 changes: 7 additions & 4 deletions src/app/shared/component/smd-fab-speed-dial/fab-speed-dial.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ import {
AfterContentInit,
ElementRef,
Renderer,
Inject,
forwardRef,
Injector,
ContentChildren,
QueryList,
ContentChild,
Expand All @@ -26,14 +25,16 @@ const Z_INDEX_ITEM: number = 23;
`
})
export class SmdFabSpeedDialTrigger {
private _parent: SmdFabSpeedDialComponent;

/**
* Whether this trigger should spin (360dg) while opening the speed dial
*/
@HostBinding('class.smd-spin')
@Input() spin: boolean = false;

constructor(@Inject(forwardRef(() => SmdFabSpeedDialComponent)) private _parent: SmdFabSpeedDialComponent) {
constructor(injector: Injector) {
this._parent = injector.get(SmdFabSpeedDialComponent);
}

@HostListener('click', ['$event'])
Expand All @@ -53,10 +54,12 @@ export class SmdFabSpeedDialTrigger {
`
})
export class SmdFabSpeedDialActions implements AfterContentInit {
private _parent: SmdFabSpeedDialComponent;

@ContentChildren(MdButton) _buttons: QueryList<MdButton>;

constructor(@Inject(forwardRef(() => SmdFabSpeedDialComponent)) private _parent: SmdFabSpeedDialComponent, private renderer: Renderer) {
constructor(injector: Injector, private renderer: Renderer) {
this._parent = injector.get(SmdFabSpeedDialComponent);
}

ngAfterContentInit(): void {
Expand Down