We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Initializing uploadObj

What's the best way to initialize:  
public uploadObj: UploaderComponent; 

I tried:
public uploadObj: UploaderComponent | null = null; (problems!)
public uploadObj: UploaderComponent = new UploadComponent(); (fails)


Using angular 14.  Thanks!


1 Reply

SP Sureshkumar P Syncfusion Team October 12, 2022 05:33 AM

Hi JASON,

We suggest you use the below code to initialize the component instance in the angular 14 application.


Find the code example:

[component.html]

<ejs-uploader #defaultupload  (created)="componentCreated($event)"></ejs-uploader>

 

[component.ts]

 

export class AppComponent {

  @ViewChild('defaultupload')

  public uploadObj!: UploaderComponent;

 

  componentCreated(args){

    console.log(this.uploadObj);

  }

}

 


Find the sample in the attachment:

Note: If this post is helpful, please consider Accepting it as the solution so that other members can locate it more quickly.

Regards,

Sureshkumar P


Attachment: uploader_9013ddb4.zip

Loader.
Live Chat Icon For mobile
Up arrow icon