I am trying to change image into Greyscale and Sepia using slider control
Here is my html code
<div class="card-body">
<input id="sepia" type="range" oninput="set(this, 'sepia');" value="0" step="0.1" min="0" max="1"> Sepia <span id="Amount_sepia">(0)</span><br/>
<input id="grayscale" type="range" oninput="set(this, 'grayscale');" value="0" step="0.1" min="0" max="1"> Grayscale <span id="Amount_grayscale">(0)</span><br/>
</div>
<img class="img-fluid" id="img_prev" src="{{actualImage}}" *ngIf="!this.showCropper" />
<image-cropper id="img_prev" class="imageclass" *ngIf="this.showCropper"
[autoCrop]="false"
[imageChangedEvent]="imageChangedEvent"
[maintainAspectRatio]="true"
[aspectRatio]="4 / 3"
[resizeToWidth]="256"
[cropperMinWidth]="128"
[onlyScaleDown]="true"
format="png"
(imageCropped)="imageCropped($event)"
(imageLoaded)="imageLoaded()"
(cropperReady)="cropperReady()"
(loadImageFailed)="loadImageFailed()" style="max-height:500px">
</image-cropper>
Here is my ts for the same
public set(e,f){
document.getElementById('img_prev').style["filter"] = f+"("+e.value+")";
document.getElementById('Amount_'+f).innerHTML="("+e.value+")";
}
I am getting error
(index):13 Uncaught ReferenceError: set is not defined
at HTMLInputElement.oninput ((index):13)