Load JS/CSS files only ipad

I’m doing one Ionic App and I’m trying to load some JS/CSS files but only if is iPad. Something like this:

`if ( is_ipad()) :


Maybe something like this could be do it in the index.html. The files will be used in all the iPad views but not in the mobile vires.

I know that I can use the Platform Classes but this doesn’t cover my needs. I’m very new in Ionic and I don’t know if this is possible.

Any help is welcome!
Thanks! :wink:

Have you tried checking the useragent of the webview?

Extract the useragent using the following:


I’d add a class to the body for iPads, of wrap the include of ipad.scss in a media query. In the index.html you can load the ipad.js and only init the class when the userAgent contains ipad (or something like that)

Thanks to all of you for the answers.

I get help from Stackoverflow too and with this code in the index.html I can load files only for iPad. Can be JS or even link to CSS

if ( ionic.Platform.isIPad() ){
    var script = document.createElement("script");
    script.src = "PATH_TO_FILE";

This is what works for me.