JavaScript window.location returns "file:///Users..." insead of "http://localhost..."

I have an app build with IONIC 1 and Angular and when I deploy it on my IPhone in javascript value of “window.location” returns “file:///Users/…” instead of “http://localhost:8100…”

What am I doing wrong ?