ngInclude using AngularJS and JavaFX - angularjs

The problem I want to solve is how to inject a separate html file into the main one in JavaFX Webview + AngularJS. I tried to use AngularJS ngInclude, but maybe there is a better way to achieve it? Ater debugging AngularJS ng-include I failed due to unsupported jar:// protocolol. Is there any way to load html files using AngularJS framework and JavaFX? HTML files are inside the jar file and AngularJS is the framework. Should I turn away from one of them or there is some solution?
Details:
I load from index.html subpage1.html using nginclude dircetive. It works outside JavaFx but fails when I use Webview inside JavaFX.

Related

AngularJS: Execute a JavaScript script after the page has loaded

I have to customize a platform designed in ASPX and AngularJS.
I only have access to the HTML and CSS code, I do not have access to the AngularJS controller.
I want to add a small JavaScript script, but I encounter a problem when I integrate it on the platform.
I cannot detect when the page is loaded.
If I use the javascript (window.onload) or jQuery ($(document).ready) functions, it doesn't work.
Since I don't have access to the AngularJS controller, do I have a way of knowing when the page is loaded?
Thank you
Florian

AngularJS Routing All Within One HTML page

I am working with a serverless HTML so JavaScript cannot load other html content. I was wondering if there is an example of pulling the template from the DOM so that I can pack all my views into a single HTML file (i.e. without having to use string templates).
Would this work?
I am working with AngularJS 1.7.5 rather than the newer Angular 2.
I need it to work with Outlook/IE.
I was thinking of just getting the .InnerHTML of some base element. Advice, notes, concerns?

Javascript Framework compatible with JQuery Plugin

I have to integrate an existing UI application to a REST based back end. The UI is a single html page that uses JQuery + CSS to create a sliding tab experience. Both the UI and REST application are Spring Boot apps.
I'm new to Javascript frameworks. AngularJS made a lot of sense to me for data binding and updating the DOM.
However, now that I am trying to do the integration, there is a .js include in the UI that contains a massive set of JQuery plugins (they are just pasted in one after another).
AngularJS functionality like 'ng-repeat' does not work with this file included. The UI application does not work without this include.
I believe the solution is to put all JQuery Plugins into a Angular Directive (Initialising jQuery plugin (RoyalSlider) in Angular JS). This looks like a painful task.
Are there other frameworks that would work with this?
I have found some threads suggesting a ground up approach with Angular ("Thinking in AngularJS" if I have a jQuery background?), but I'm stuck with this current UI app's structure.
Suggestions? I'm thinking of using JQuery to acquire the JSON and inject it into the UI and adding Thymeleaf for its fragments.
After some research I have found that using JQuery is the way to go if your application was built with JQuery. If I could do it again, perhaps Angular should have been the base for the UI application. However,after some exploration, I have found JQuery does a lot of cool things around AJAX and Dom manipulation. When used with ThymeLeaf in Spring Boot, you end up with a power set of UI tools.

Angular routing and dynamically loading controllers

We are creating a single page app with Angular routing.
The problem is that the Javascript with the controller(s) need to be referenced.
I want the js file to be downloaded dynamically on demand.
Is it mandatory to use a system like RequireJS ? Is there an alternative ?
AngularJS is just a wrapper over pure JS to make a system that's defined in its documentation (MVC, two-way binding, directive and so on). So, you can download the JS and bind the controller defined in the file to the angular app (ng-app). You don't need to use RequireJS to load the file, rather you can use pure JS to do the work.
Most people use requirejs but you can do it in pure JS.
stackoverflow.com/questions/7718935/load-scripts-asynchronously

Changing pages in AngularJS (under requireJS)

I'm a beginner in AngularJs and I have a simple question: How do I change pages in AngularJS?
Not using router (ng-view) in AngularJS since I need a new html page where there's no common templates. I tried to use "ng-href" but it doesn't work well, since the system works under requireJS and the new html doesnt contain any js or css that I need. (except I force to add them..)
Does anyone has got some idea?
you can achieve with some template engine like "Swig" http://paularmstrong.github.io/swig/ with has a layout template were you base js and css and you can extend it.

Resources