How to restrict app rotation?

Hi, I think this question has been discussed and answered before on the Ionic forum, the simplest way seems to be this:

Freezing portrait mode

So, quoting the answer:

In config.xml include following:

<preference name="SplashScreen" value="screen" />
<preference name="orientation" value="portrait" />
<preference name="SplashScreenDelay" value="5000" />

and inside $ionicPlatform.ready(function() {}) include following:

if(window.navigator && window.navigator.splashscreen) {
window.plugins.orientationLock.unlock();
} 

I saw more discussions and solutions but this seems to be the easiest one.