Skip to content

Commit

Permalink
Fixed #7760 - Refactor forwardRef injects
Browse files Browse the repository at this point in the history
  • Loading branch information
cagataycivici committed Jun 1, 2019
1 parent 5a94e4c commit a3b1759
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 9 deletions.
6 changes: 5 additions & 1 deletion src/app/components/accordion/accordion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,11 @@ export class AccordionTab implements OnDestroy {

loaded: boolean;

constructor( @Inject(forwardRef(() => Accordion)) public accordion: Accordion) {}
accordion: Accordion;

constructor( @Inject(forwardRef(() => Accordion)) accordion) {
this.accordion = accordion as Accordion;
}

ngAfterContentInit() {
this.templates.forEach((item) => {
Expand Down
6 changes: 5 additions & 1 deletion src/app/components/contextmenu/contextmenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@ export class ContextMenuSub {

@Input() root: boolean;

constructor(@Inject(forwardRef(() => ContextMenu)) public contextMenu: ContextMenu) { }
contextMenu: ContextMenu;

constructor(@Inject(forwardRef(() => ContextMenu)) contextMenu) {
this.contextMenu = contextMenu as ContextMenu;
}

activeItem: any;

Expand Down
6 changes: 5 additions & 1 deletion src/app/components/menu/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,12 @@ import {RouterModule} from '@angular/router';
export class MenuItemContent {

@Input("pMenuItemContent") item: MenuItem;

menu: Menu;

constructor(@Inject(forwardRef(() => Menu)) public menu: Menu) {}
constructor(@Inject(forwardRef(() => Menu)) menu) {
this.menu = menu as Menu;
}
}

@Component({
Expand Down
6 changes: 5 additions & 1 deletion src/app/components/organizationchart/organizationchart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,12 @@ export class OrganizationChartNode {
@Input() first: boolean;

@Input() last: boolean;

chart: OrganizationChart;

constructor(@Inject(forwardRef(() => OrganizationChart)) public chart:OrganizationChart) {}
constructor(@Inject(forwardRef(() => OrganizationChart)) chart) {
this.chart = chart as OrganizationChart;
}

get leaf(): boolean {
return this.node.leaf == false ? false : !(this.node.children&&this.node.children.length);
Expand Down
10 changes: 7 additions & 3 deletions src/app/components/slidemenu/slidemenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,13 @@ export class SlideMenuSub implements OnDestroy {
@Input() easing: string = 'ease-out';

@Input() index: number;

constructor(@Inject(forwardRef(() => SlideMenu)) public slideMenu: SlideMenu) {}


slideMenu: SlideMenu;

constructor(@Inject(forwardRef(() => SlideMenu)) slideMenu) {
this.slideMenu = slideMenu as SlideMenu;
}

activeItem: any;

itemClick(event, item: MenuItem, listitem: any) {
Expand Down
6 changes: 5 additions & 1 deletion src/app/components/tieredmenu/tieredmenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,12 @@ export class TieredMenuSub {

@Input() hideDelay: number = 250;

constructor(@Inject(forwardRef(() => TieredMenu)) public tieredMenu: TieredMenu, private cf: ChangeDetectorRef) {}
tieredMenu: TieredMenu;

constructor(@Inject(forwardRef(() => TieredMenu)) tieredMenu, private cf: ChangeDetectorRef) {
this.tieredMenu = tieredMenu as TieredMenu;
}

activeItem: HTMLLIElement;

hideTimeout: any;
Expand Down
6 changes: 5 additions & 1 deletion src/app/components/tree/tree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,11 @@ export class UITreeNode implements OnInit {

@Input() lastChild: boolean;

constructor(@Inject(forwardRef(() => Tree)) public tree:Tree) {}
tree: Tree;

constructor(@Inject(forwardRef(() => Tree)) tree) {
this.tree = tree as Tree;
}

draghoverPrev: boolean;

Expand Down

0 comments on commit a3b1759

Please sign in to comment.