app.config(["$provide", ($provide: any) => { $provide.decorator("GridRenderContainer", ["$delegate", ($delegate: any) => { $delegate.getVerticalScrollLength = function getVerticalScrollLength() { console.log("current scroll length -> " + Math.abs(this.getCanvasHeight() - this.getViewportHeight()) + this.grid.scrollbarHeight); return Math.abs(this.getCanvasHeight() - this.getViewportHeight()) + this.grid.scrollbarHeight !== 0 ? Math.abs(this.getCanvasHeight() - this.getViewportHeight()) + this.grid.scrollbarHeight : -1; }; return $delegate; }]); }]);