CodeEffects: Load RuleEditor On button Click - codeeffects

Is it possible to load different partial views in my Index.cshtml that contains the CodeEffect().RuleEditor().
Thanks.

The rule editor of Code Effects engine is a plain client class. It can be used as any other js component. Do you have a particular issue with your project or you are asking how to code partial views?

Related

Including HTML in Angular application at compile time

I know the question looks like some others I could read but it's not the exact same issue in my opinion.
I have a "loading screen" (small piece of HTML) in my Angular application. This loading screen is present in three places :
When the application is not loaded yet (so inside the tag of the root component in the index.html : <app-root>my loading html</app-root>
When the router inside the root component is not yet ready to display the "final" component. (See answer here for more detail)
In the "final" component itself waiting for some data to be loaded from an HTTP service.
In the second and the third cases the "loading screen" could be in another component. But it's not possible for the first one since another component will only be displayed after the app is fully loaded and we want the first loading screen to be visible as soon the user get the index.html.
So for the moment I have this short "loading screen" HTML duplicated in multiple places.
I don't care if it's duplicated once built and delivered to the user but from a code point of view I want it to exist only once... (You know how it is, when someone will have to change the message it will be forgotten in the other places...)
I could use iframe (or object but W3C advise to use iframe instead) but people here want to avoid it at all cost so I think the code duplication will be preferred to this solution.
I could also have a small JS to do it (like this answer) but it feel wrong to add a "wild js" in an Angular app...
My question is : Do I have a way to include HTML file into another HTML file (like the "include()" in PHP) with some markup (like in this answer about Service Side Include) that could be resolved during the Angular compilation?
I mean the AOT compilation is already checking the HTML template so it could be quite easy...
Thanks in advance!
It's not in the compilation time, but a way to do something similar to what you are asking, is this:
You could have your "loading screen" html code as a component (for instance, app-loading-component), declared and exported inside a Shared Module.
Then, in the component 'X' in which you want to use it, you have to import the Shared Module in the section imports:[] of the module of that 'X' component, and used it in your HTML in the usual way:
<app-loading-component></app-loading-component>

Isn't the html of the form Django displays on the screen?

Django shows you forms when you do basic coding, right?
Where is the html of the automatically generated form in windows?
So instead of looking for a template folder, once the developer writes the url or views code, he finds the location of the skeleton-only html that Django shows.
In my opinion, it looks like it's built somewhere like an "anaconda/envs" contains a separate virtual environment, but I can't find it.
it's maybe path?
It's well documented:
https://docs.djangoproject.com/en/2.2/ref/forms/renderers/
It loads templates first from the built-in form templates directory in
django/forms/templates
unless you have 3rd party libraries included that override these templates.
However, a quick check in https://github.com/django/django/tree/master/django/forms/templates/django/forms/ shows that this directory is empty.
tl;dr
Django does not render any forms from scratch (unless it's the Admin which of course creates its whole UI automatically). It just enables you to quickly create a template that can render your form but you will still have to provide a basic template (aka HTML markup with dynamic parts) yourself.

UI5 doesn't work with AngularJS

I have a single page application written in AngularJS. I need to put a UI5 text field there (for testing purposes) that I am using with Declarative Support.
I have 2 files:
index.html
sap.html.
In my index.html I have <div class="mainView" ng-view></div>
and there I inject sap.html into the index.html.
when I write this line in my index.html I see the sap text field:
<div data-sap-ui-type='sap.ui.commons.TextField' id='message' class='my-button' data-value='Hello World'></div>
However, when I put this code in sap.html the text field isn't being shown in the browser.
When I look in the chrome F12 source mode - I see that the UI5 related tag has been evaluted into textbox in the index.html. This doesn't happen in the sap.html (the "injected by angular ng-view" page) - I just see the tag "as is" - the DOM in the injected page was not evaluted.
Why is that happening? Does AngularJS bootstrap or life cycle
interfere with sap boostrap?
Any way to fix it?
I need to use AngularJS because it is a part of an existing app. A re-write of the app is not an option for me.
Thanks
I never came across this scenario and really do not consider this a good solution (but this is my opinion). I wonder why do you expect UI5 to be aware of AngularJS injecting markup dynamically?
However, the documentation shows an example of how to compile dynamically loaded markup. Obviously AngularJS provides an event to listen to reloads of ngView content, maybe it is possible to trigger the compliation there.

What is the difference between ng-include and ngroute in angularjs

I'm newly started from the angularJs web application using html. I want to know about the difference between ng-include and ngroute in angularjs and also when should i use of them. If anybody can know this please give me an example to learn it.
Thanks and regards,
Parthi
ng-include just dumps the included html into the DOM.
ng-route has lots of different capabilities, including route parameters.
You can see that the URL changes when you go to different routes.
Primarily routes are used for having a single page app. Different pages of the app are routed into the ng-view. You can then go to these pages by URL since the router will automatically resolve these routes to the right view.
ng-include is called a directive in angular, its a core concept in Angular. It lets you include partial html files in your page.
ng-route is an extra component you can add to your angular application that allows you to work with the routing of URL and data. In order to use it you need to reference it as a dependency.
angular.module("app", ["ngRoute"]);
The differences:
one is a extension of angular with routing capability the other one
is a built-in directive that lets you include markup on your page
from another location.
ng-include is used on the markup <div data-ng-include="..."></div>
ng-route is used and reference in your JavaScript files.

Returning HTML in MVC

We are building a lot of applications for one business solution. I need to embed a feature of another application into my application. For example, Accounting needs to have the "Customer Management" feature of the Customer Manager, so I just make call to Customer Manager application to retrieve this feature in HTML and display inside my application.
All of them are written in ASP.NET MVC (C#).
Could you please give me some advice to solve this technical problem?
Thanks a lot.
Many solutions, depending on your exact needs. Some of them:
If the HTML is from another web app:
Use javascript to make a ajax call to an action of this another webapp and insert the response (should be a PartialView) in one DOM element. Look at jquery.get as an example.
If the HTML is from your web app
You can include the HTML when the view is rendered by using #Html.Partial or #Html.Action. The first includes a partial view in your view, the second includes the response of a controller's action of your application in the view.
Another option is to pass the HTML as a property of your ViewModel. And use #Html.Raw to display it in the view.
Greetings