Imported Onsen UI webpage has no iPhone preview but "This is a template for Monaca app."
-
Hello,
i let import a web page “app” built with Onsen UI into Monaca. The iPhone preview shows only “This is a template for Monaca app.”.
Comparing with the “Hello World” demo project, my Onsen UI web page includes no Cordova / PhoneGap references.
Due to the note at https://onsen.io/v2/guide/hybrid/cordova.html I was under the impression Monaca lifts off any integration work for me.
What do I have to do to let Monaca recognise my Onsen UI project as a source for an iOS (and preferrably any other supported plattform) app?
-
In the default Monaca project, the source files are in the www directory. It sounds like you need to move your Onsen UI source files to the www directory. Make sure your main file is at www/index.html. Then add the following to the <head> tag of your index.html to include Cordova:
<script src=“components/loader.js”></script>
<link rel=“stylesheet” href=“components/loader.css”>
-
Thank you very much!
Indeed, my imported files and folders were all put on root level.
Thanks to https://en.docs.monaca.io/products_guide/monaca_ide/dependencies/file_dir and https://en.docs.monaca.io/products_guide/monaca_ide/dependencies/components I just read before your reply I just got a working iPhone preview!