export class FloorPlanComponent implements AfterViewInit, OnInit {
constructor();
constructor(public _baseComponentService?: BaseComponentService,
public _internalZoneService?: InternalZoneService,
public routeParams?: ActivatedRoute,
public internalAssetService?: InternalAssetService,
public slimLoadingBarService?: SlimLoadingBarService,
private errorLoggerService?: ErrorLoggerService
) {
if (this._baseComponentService != null) {
this._baseComponentService.SetPageTitle("Zones - Internal");
}
this.imgDelZone = parentElement.append("image")
.attr("id", "delZone" + newId)
.attr("idCounter", newId)
.attr("r", "NaN")
.attr("stroke-width", 0)
.attr("opacity", 0.8)
.attr("x", function (d) { return d.x + (shapeWidth - 22); })
.attr("y", function (d) { return d.y + 1; })
.attr("style", "opacity: 1; stroke-width: 1;")
.attr("xlink:href", "../app/assets/images/Remove_Delete-22.png")
.attr("preserveAspectRatio", "none")
.attr("transform", " ")
.attr("height", 18)
.attr("width", 18)
.attr("cursor", "pointer").on("click", function () {
var comp = new FloorPlanComponent();
comp.promptDeleteZone(this);
});
}
Inside "click" function, I want to use this to refer my class. But it's referring this as a window object. To resolve this issue, I created a object of class with the help of parameterless constructor. But according to this, I'm unable to get any service. Please help.