Add footer to the page

I want to add footer to each page in my application.
Expected behaviour → Footer should be shown at end of every page when I scroll down to bottom of page i.e. footer should not be sticky at bottom of page, it should be shown after scroll down if scroll is applicable , if scroll is not applicable then it should be stick to the bottom of page. I am loading different pages using and I am trying to add footer like :

div
ion-router-outlet
ion-router-outlet
div
div
test footer
div

But it is not showing at the end of page. It is showing at top of page and it is not visible as well. But when I set position absolute then it is getting visible. So how I can show footer after each page when I scroll down to the bottom of page?