I used this jQuery code and it is working fine. But I want to use the same flow in angular. Is it possible? Can we write for beforeunload
function in angular?
$(window).on('beforeunload', function(){
$(window).scrollTop(0);
});