Skip to content

RecursiveTreeFolderComponent

reference
1 min readUpdated

Kind: Class

Source: Pams/Web/Pams.Web/Client/app/components/files/recursive-tree-folder/recursive-tree-folder.component.ts (line 14)

Part of: Pams

RecursiveTreeFolderComponent is an Angular component for representing a folder within a recursive file-tree view. It coordinates folder selection, expansion handling, and initialization through folderClickedHandler, folderExpendedHandler, ngOnInit, and onInitialized.

Implements: OnInit

Methods

MethodSignatureReturns
ngOnInitngOnInit()void
folderClickedHandlerfolderClickedHandler(data: DataEmitted)void
folderExpendedHandlerfolderExpendedHandler(folder: OneDriveFilesList, levelIndex: number)void
onInitializedonInitialized(e: undefined)void

Properties

PropertyType
folderItemsOneDriveFilesList[]
levelIndexnumber
folderClickedany
folderExpandedany
selectedFolderIdstring
subscriptionSubscription
updateTopContentany
updateBottomContentany
updateContentTimerany
updateContentany

Diagram

mermaid
graph LR
    Parent[Parent File Tree] --> Folder[RecursiveTreeFolderComponent]
    Folder --> Init[ngOnInit]
    Init --> Ready[onInitialized]
    UserClick[Folder Click] --> ClickHandler[folderClickedHandler]
    UserExpand[Folder Expand/Collapse] --> ExpandHandler[folderExpendedHandler]
    ClickHandler --> Folder
    ExpandHandler --> Folder

Usage

typescript
import { Component, ViewChild } from '@angular/core';
import { RecursiveTreeFolderComponent } from './components/files/recursive-tree-folder/recursive-tree-folder.component';

@Component({
  selector: 'app-file-browser',
  template: `
    <app-recursive-tree-folder></app-recursive-tree-folder>
  `
})
export class FileBrowserComponent {
  @ViewChild(RecursiveTreeFolderComponent)
  folderComponent?: RecursiveTreeFolderComponent;

  refreshFolderTree(): void {
    this.folderComponent?.onInitialized();
  }
}

AI Coding Instructions

  • Keep folder click behavior inside folderClickedHandler so selection logic remains in the folder component.
  • Handle folder expansion and collapse through folderExpendedHandler; preserve the existing method name when updating callers.
  • Do not call ngOnInit directly from application code; Angular invokes it during component initialization.
  • Use onInitialized for work that depends on the component being ready after initialization.

Used by

1 reference from 1 file. Each is a place in this repository where the symbol is actually used — go read one rather than trusting an example.

Imported by (1)

  • TranslateHandlerPams/Web/Pams.Web/Client/app/app.module.ts:1

Was this page helpful?

Download as PDF