How To Force Ionic/Angular Project To Use Https

This was a thing I had to look up on stack-overflow.

 this.forceSSL = function () {
    if ($location.protocol() !== 'https') {
        $window.location.href = $location.absUrl().replace('http', 'https');
     }
    };

 this.forceSSL();

You can put this function in your service file and then call it every time a page loads.