Thank you very much Jamal! it was so easy with monaca cloud IDE! I just choose minimum template for onsenui app, and add own html body and own js, and its working pretty neat now, you have saved hours of my time, thank you once again
@Terumi@khemry To be more precise, your source files are under src folder. You should not modify www folder because those are automatically generated files. While developing, monaca preview will cache your files in memory but it will not generate files in the disk. Therefore, whenever you want to build locally using Cordova, you need to generate the files by running monaca transpile.
If you used Vue CLI to create the project instead of Monaca CLI, then you’ll need to run npm run dev instead of monaca preview and npm run build instead of monaca transpile.
@humblecoder You should be able to use “pure” cordova, indeed. But then, you are trying to run Monaca commands here, right? There is a Monaca guide here for this specific template. This link (and more info) is shown in the terminal right after vue init OnsenUI/vue-cordova-webpack command finishes but I guess you didn’t see it.
Vue CLI templates are a bit different from the rest of Monaca templates, so instead of monaca preview you’ll need to run npm run dev (it’s how Vue CLI templates work by default). I think all the necessary stuff is explained in that guide anyway
For creating projects without templates, well, you basically need to know how to create a Vue project. Onsen UI is just a plugin for it and you can see how to include it in the docs. After that, if you want your Vue app to be Cordova-like, have a look at their project structure guide. The most important things are config.xml and www folder (with all the public files). The rest is using Cordova CLI to add platforms and plugins, or Monaca CLI.
Therefore, what the templates provide is basically a Vue app with Onsen UI imported and a config.xml file. The build process has been also a bit changed to produce a www folder instead of the default dist folder.
Edit: I just tried with Cordova CLI and the problem is the same, it simply needs www so you need to run npm run build.
I had, in fact, tried placing <ons-navigator> around my <ons-page>, inside my <ons-page> around all of the content, and as a landing page from <ons-tab>, using the [page] directive to point to my page.
I have tried every way I can think of to make my <ons-page> a child of an <ons-navigator>
The last variant worked without using the <ons-tabbar> and <ons-tab> elements. I suspect that the <ons-navigator> needs to be the outermost item from things I’ve seen in the documentation, but if I try to go there from an <ons-tab>, the code wraps the <ons-navigator> in <ons-page>.
What I would really like to see is sample code that actually does what I want.
If I create a service, is it sufficient to create a Component where the template is just: <ons-navigator></ons-navigator> and the constructor gets the OnsNavigator injected. Then can I just retrieve the navigator using that navigator? I’ve now tried several ways to create a service, but still haven’t figured out how to get an OnsNavigator into anything to use as a service. I don’t know how to instantiate a component directly in a service.
I want the navigator and tabbar to be available simultaneously. According to everything I’ve read, a Component is part of the DOM and associated with the View process. This seems to imply that any Component containing an <ons-navigator> would itself have to be “between” the tabbar and its viewable area, or it wouldn’t work. I have not figured out how to make one work.
If it’s possible to create an <ons-tabbar> where multiple button targets are <ons-navigator> elements, using the current ngx-onsenui and onsenui, there should be a test case for it. If so, please post it. If there isn’t a test case, maybe it doesn’t actually work. I’ve used every example I can find, and variations on them. I hope I’m just overlooking something obvious. I don’t have nearly as much experience in Angular 4 or Onsen UI as I do in many other languages, so it may well be something I’m doing.
I have gotten <ons-navigator> and <ons-tabbar> elements working, and I like them. I just can’t figure out how to get them to work together.