Local variable and event binding support for the mdbFileSele


Topic: Local variable and event binding support for the mdbFileSelect seems to be missing

chakkit pro asked 5 years ago

Here is the example from Angular cheatsheet (https://angular.io/guide/cheatsheet).

<video #movieplayer ...>
<button (click)="movieplayer.play()">
</video>

In this case, we use file input so here is my example.

<input type="file" #uploader>
<a (click)="uploader.click()">Replace this image?<a>

It's working when no mdbFileSelect added otherwise causes below error.

ERROR TypeError: jit_nodeValue_3(...).click is not a function at Object.eval [as handleEvent] (ImageComponent.html:19) at handleEvent (core.js:38098) at callWithDebugContext (core.js:39716) at Object.debugHandleEvent [as handleEvent] (core.js:39352) at dispatchEvent (core.js:25818) at core.js:37030 at HTMLImageElement. (platform-browser.js:1789) at ZoneDelegate.invokeTask (zone-evergreen.js:398) at Object.onInvokeTask (core.js:34182) at ZoneDelegate.invokeTask (zone-evergreen.js:397)


Arkadiusz Idzikowski staff commented 5 years ago

Could you provide full html and ts code on which we will be able to reproduce this problem? I tried to use your code and mdbFileSelect in the same view but there is no such error. Are you sure there are no duplicates of template variable #uploader?


chakkit pro commented 5 years ago

The code I've provided is working as based on the Angular doc.What is not working is when adding mdbFileSelect to the input.

Please try again with this one:

<input mdbFileSelect type="file" #uploader><br>
<a (click)="uploader.click()">Replace this image?<a>

Arkadiusz Idzikowski staff commented 5 years ago

Thanks for the clarification. We will take a closer look at this problem.


Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Open

Specification of the issue
  • User: Pro
  • Premium support: No
  • Technology: MDB Angular
  • MDB Version: 8.0.0
  • Device: Desktop
  • Browser: Chrome
  • OS: Windows10
  • Provided sample code: No
  • Provided link: Yes