I have user.component.html and user.component.ts
All examples I found were in html this way <input type="file" />
I don't want to use this style. I have in my html file:
<button type="button" class="btn" (click)="openPicture()" Browse </button>
Below is the function on ts file:
public openPicture() {
//for testing
console.log('button clicked to open picture');
var picture = browse.the.picture.and.assing.to.this.variable;
//another test, see on console if picture is read
console.log('%c ', 'font-size: 100px; background: {{picture}} no-repeat;');
// Later display picture variable on html and save to database or do anything desired.
}
I have found an example on stackoverflow with angular/material
but I dont have this module. Is there any other alternative way, without installing any extra package to solve this?