I have created an sample hybrid app using telerik app builder CLI. The project loads an initial home screen from a COMPONENTS folder in the project. Now i have Home folder with an index.js and view.html in it and the Home folder is inside Components. I added About folder with an index.js and view.html in it.
Both view.html have a div inside it. Now i need to know how to navigate from home to about. This has to happen from the JS. I tried
var app = new kendo.mobile.Application();
app.navigate("#AboutView");
"#AboutView" is the id of the div in view.html in About folder. This doesn't work. Could someone provide any help
with remote views ... you will need to provide the full path. and the reference is always from the root of the project. so in your case it will be
components/About/view.html
http://docs.telerik.com/kendo-ui/mobile/application#remote-views
Related
I am new to programming and trying to convert a html templete into a react app and i have copy the assets folder and paste it into the public folder of react app and all the link and scripts from the index.html of templete into index.html of the react app but when i am trying to convert the html code into react component then the main.js file functions of vendor folder not working in the component and the function of vendor folder's are showing not defined in main.js of react app.
I am expecting not to change the js code of main.js and it should work as normally as working in the html templete.
here the link to a project I am working on to learn express / ejs / API.
https://github.com/aspnet82/books
I would like to add a second JS file to manage clicks etc.. possibly using jQuery (also vanilla JS is ok... at the moment there is no jQuery installed).
// books.ejs
<script src="public/js/index.js" charset="utf-8"></script>
</body>
But when I add the tag and indicate the index.js as source into the books.ejs file the content of the webpages is not showing anymore, is like either the app.js or the index.js are loaded at time.
If index.js is empty the ejs file is loaded properly.
What is the best way to manage events on a node / express app? For example, if I click on a element. Is this a Js file into the public folder as it is static content? and how do I call this in the app.js file?
Thanks for any help
I'm building an Electron app that needs to have multiple pages. I've looked at Vue Router (I'm already using Vue) as a routing system, but I'd like to store every page a a separate HTML file.
I've tried a couple of things:
Making an Ajax request to the page, then putting its contents into the route. When trying to navigate to the route, I got a route not allowed error.
Making an Ajax request to the page, then replacing the #app element's contents with the requested page. This caused the {{ template_things }} to stop working.
I'm open to using other routing systems, too. Vue Router just seemed the most convenient.
Thank you!
You could try out Nuxt.JS.
The big innovation of Nuxt.js comes with the nuxt generate command.
When building your application, it will generate the HTML for every one of your routes and store it in a file.
For example, the following file structure:
-| pages/
----| about.vue
----| index.vue
Will generate:
-| dist/
----| about/
------| index.html
----| index.html
There is an Electron starter app with Nuxt on GitHub
I'm building an app in Angular7 and it's ready to go but I need to create a plain javascript (hopefully could be minified) to be included in the websites which are going to use the main Angular app. This script will embed the app into an iframe when users click buttons or links. What I want is to have that script and the Angular app as part of the same bundle but not included as part of the angular app. Just available to control what the host website can do to embed our main app. If there is another approach to solve this problem I will appreciate it
Create custom js file
exports.myFunction = function myFunction() {
alert('External custom js');
}
Add this JavaScript file in scripts array in angular.json file.
"scripts": [
.....
"src/assets/js/custom.js"
]
If in your js file have function myFunction you can declare in the component
import {myFunction} from '../assets/js/custom.js';
I make a demo for custom.js
https://stackblitz.com/edit/angular-custom-js?file=src/app/app.component.ts
When Load my Rails ember app I get a blank screen because ember is trying to find my application and index templates at
Ember.TEMPLATES['application] and Ember.TEMPLATES['index']
But when I run Ember.TEMPLATES in the console it brings up all the templates as 'app/application' and 'app/index'.
So ember is looking for /application.hbs but cant find it because for some reason the templates are listed as app/application. But the actual file structure of app is:
assets -> javascripts -> app -> templates -> application.hbs and index.hbs
So their direct parent is not 'app/'
Any idea why its doing this and how to fix it?
Thank you!
Ember-Rails compiles the handlebars from the assets/javascripts directory directly.
You have two options, modify your hierarchy to not use the app folder.
Or set config.handlebars.templates_root = 'app' in your application.rb.