Skip to main content

Upload

This section describes the BfmCostCenterUploadComponent component.

Usage

You can import the BfmCostCenterUploadComponent directly in your route configuration.

import { BfmCostCenterUploadComponent } from '@celerofinancas/ui-company-kit';

const routes = [
{
path: 'cost-center-upload',
component: BfmCostCenterUploadComponent,
},
];

But if you need more customization, you need to import it in your module and use it in your template.

cost-center-upload.component.ts

import { BfmCostCenterUploadComponent } from '@celerofinancas/ui-company-kit';

@Component({
standalone: true,
selector: 'cost-center-upload',
imports: [BfmCostCenterUploadComponent],
templateUrl: './cost-center-upload.component.html',
})
export class CostCenterUploadComponent {}

Then, in your template, you can use the component like this:

cost-center-upload.component.html

<bfm-cost-center-upload
[acceptFile]="'.csv'"
[downloadTemplateModel]="true"
(uploadResult)="handleUploadResult($event)"
/>

Inputs

The BfmCostCenterUploadComponent component has the following inputs:

acceptFile

File extension accepted by the component.

TypeDefault
string'.csv'

downloadTemplateModel

Flag to enable the download of the template model.

TypeDefault
booleantrue

Events

The BfmCostCenterUploadComponent component has the following events:

uploadResult

Event emitted when the upload is completed.

TypeDefault
EventEmitternew EventEmitter()