Skip to main content

Events management

Component have a lot of events that you can use to hook into the component's lifecycle. You can find a list of all events on this page.

Events types

You can handle the following events from the component:

  • progress - The upload progress event. The event detail is the upload progress in percentage.
  • success - The upload success event. The event detail is the upload result.
  • error - The upload error event. The event detail is the error message.

Code example

import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import '@fazio/ipfs-upload-button';

@Component({
standalone: true,
schemas: [CUSTOM_ELEMENTS_SCHEMA],
selector: 'app-root',
template: `
<div>
<web3-upload-btn
token="{{token}}"
isdisplayresult="true"
isdisplaytoast="true"
(success)="successEvent($event)"></web3-upload-btn>
</div>
`
})
export class AppComponent {
token = 'WEB3STORAGE_APIKEY'

successEvent(e) {
console.log(e.detail)
}
}