How to achieve single code base for mobile and desktop application?

example -

I want to create a Navigation Menu like this for my Desktop Application in ionic 2 and angular 2 like this:


and I want to tweak this same html code for its respective MOBILE VERSION and I should be getting a HAMBURGER MENU instead of the above horizontal menu when that app is opened on a mobile phone.

P.S (There should be a single html page for both mobile and desktop)

I am new to ionic and angular and need assistance.

Thanks in Advance!