Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
cetincakiroglu committed Jan 4, 2024
2 parents 29508c2 + bfb14be commit 7b4d0a1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/app/components/dropdown/dropdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -474,12 +474,12 @@ export class Dropdown implements OnInit, AfterViewInit, AfterContentInit, AfterV
@Input() optionGroupChildren: string = 'items';
/**
* Whether to display the first item as the label if no placeholder is defined and value is null.
* @deprecated since v17.3.0, set initial value by model instead.
* @group Props
*/
@Input() autoDisplayFirst: boolean = true;
/**
* Whether to display options as grouped when nested options are provided.
* @deprecated since v17.3.0, set initial value by model instead.
* @group Props
*/
@Input() group: boolean | undefined;
Expand Down
12 changes: 8 additions & 4 deletions src/app/showcase/doc/tree/lazydoc.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, OnInit } from '@angular/core';
import { Component, OnInit, ChangeDetectorRef } from '@angular/core';
import { MessageService, TreeNode } from 'primeng/api';
import { Code } from '../../domain/code';
import { NodeService } from '../../service/nodeservice';
Expand All @@ -21,13 +21,14 @@ export class LazyDoc implements OnInit {

files!: TreeNode[];

constructor(private nodeService: NodeService, private messageService: MessageService) {}
constructor(private nodeService: NodeService, private messageService: MessageService, private cd: ChangeDetectorRef) {}

ngOnInit() {
this.loading = true;
setTimeout(() => {
this.nodeService.getLazyFiles().then((files) => (this.files = files));
this.loading = false;
this.cd.markForCheck();
}, 1000);
}

Expand All @@ -40,6 +41,7 @@ export class LazyDoc implements OnInit {
this.messageService.add({ severity: 'info', summary: 'Children Loaded', detail: event.node.label });
});
this.loading = false;
this.cd.markForCheck();
}, 200);
}
}
Expand All @@ -53,7 +55,7 @@ export class LazyDoc implements OnInit {
</div>`,

typescript: `
import { Component, OnInit } from '@angular/core';
import { Component, OnInit, ChangeDetectorRef } from '@angular/core';
import { MessageService, TreeNode } from 'primeng/api';
import { NodeService } from '../../service/nodeservice';
Expand All @@ -67,13 +69,14 @@ export class TreeLazyDemo implements OnInit {
files!: TreeNode[];
constructor(private nodeService: NodeService, private messageService: MessageService) { }
constructor(private nodeService: NodeService, private messageService: MessageService, private cd: ChangeDetectorRef) {}
ngOnInit() {
this.loading = true;
setTimeout(() => {
this.nodeService.getLazyFiles().then((files) => (this.files = files));
this.loading = false;
this.cd.markForCheck();
}, 1000);
}
Expand All @@ -86,6 +89,7 @@ export class TreeLazyDemo implements OnInit {
this.messageService.add({ severity: 'info', summary: 'Children Loaded', detail: event.node.label });
});
this.loading = false;
this.cd.markForCheck();
}, 200);
}
}
Expand Down

0 comments on commit 7b4d0a1

Please sign in to comment.