Kind: Class
Source: Pams/Web/Pams.WebApp/Client/app/models/common/files.model.ts (line 5)
Part of: Pams
File is a client-side model for file-related data in the Pams web application. Its clone and cloneList methods create copied File instances for workflows that should not mutate an existing model.
Methods
| Method | Signature | Returns |
|---|---|---|
clone | clone(fi: File) | File |
cloneList | cloneList(FL: File[]) | File[] |
Properties
| Property | Type |
|---|---|
FileID | number |
FileName | string |
FileTitle | string |
ParentFileID | number |
FileType | string |
FilePath | string |
UploadedFileID | string |
SizeInBytes | string |
CreationDate | Date |
ModificationDate | Date |
CreatedByID | number |
ModificatedByID | number |
CompanyBranchID | number |
selected | boolean |
FileTags | Tag[] |
FileComments | Comment[] |
Diagram
mermaidgraph LR File[File model] --> Clone[clone(): File] File --> CloneList[cloneList(): File[]] Clone --> FileCopy[Copied File] CloneList --> FileCopies[Copied File list]
Usage
tsimport { File } from 'app/models/common/files.model';
function prepareFileCopies(sourceFile: File): File[] {
const copiedFile: File = sourceFile.clone();
const copiedFiles: File[] = sourceFile.cloneList();
return [copiedFile, ...copiedFiles];
}
AI Coding Instructions
- Call
clone()before changing aFilemodel that may still be referenced elsewhere. - Use
cloneList()when the calling code expects an array of copiedFilemodels. - Avoid confusing this application model with the browser's native
Filetype. - Keep imports pointed at
app/models/common/files.modelwhen working with this model.
Relationships
- IMPORTS →
Tag - IMPORTS →
Comment
Used by
5 references from 5 files. Each is a place in this repository where the symbol is actually used — go read one rather than trusting an example.
Imported by (5)
FilesService—Pams/Web/Pams.WebApp/Client/app/services/common/files.service.ts:1PersonService—Pams/Web/Pams.WebApp/Client/app/services/person/person.service.ts:1FilesPortService—Pams/Web/Pams.WebApp/Client/app/services/shared/files-port-service.service.ts:1Person—Pams/Web/Pams.WebApp/Client/app/models/person/person.model.ts:4PortData—Pams/Web/Pams.WebApp/Client/app/models/shared/files-port.model.ts:2
Was this page helpful?