Angular Attributes Not recognized by Day CQ Link Checker Transformer - angularjs

I am using "Day CQ Link Checker Transformer" for URL mapping on a project,
yet I need to transform a link on a button based on angularJS.
But when I try to add Data-navurl on Day CQ Link Checker Transformer,
it does not transform the URL on the web page.

The Link Checker Transformer will not work for Angular applications as your markup is contained within <script> tags. You will need to force the rewriting of the url using a JSP tag library or HTL Sling Model.
UPDATE:
To explain further... the LinkCheckerTransformer works just like any other transformer in the Sling rewriting pipeline, it responds to SAX events from the HTML parser. This means that it may not rewrite all links within your HTML page unless it is configured to generate an event. For example, <input> tags may be used to hold open redirects – these will not be rewritten unless the INPUT tag is added to the HTML parser and input:value is added to the list of rewrite elements. You can try to add SCRIPT tags to the HTML parser but I'm not sure how the parsing would behave...

Day CQ Link Checker Transformer does not check anything on the text level of XML DOM structure. It treats HTML as an XML document and rules are only applied to elements and attributes.
In your case the angular template is part of a <script> element but it is treated as a text and therefore it is skipped.
This is no different from writing a normal JS to inject a link in your page. Link checker will gracefully ignore the script text.

Related

How to add custom html tag in salesforce lightning web component?

I want to include a custom JS and a custom html tag in salesforce lightning component.
For example: I want in include a JavaScript webcomponent in LWC. So I need to include a custom js file and custom html tag in component cmp file. But currently cmp file support only some set if html tags.
You're supposed to upload the 3rd party library as a static resource and then reference it in aura/lwc. Exact syntax varies a bit. Or (in aura) you can use https://developer.salesforce.com/docs/component-library/bundle/ltng:require/documentation to load something that will effectively end up in an iframe. (You tagged lwc but your post keeps talking about aura's cmp file...)
3rd party libraries might fail to execute properly due to lightning locker (Salesforce disabling unsafe elements of JavaScript) or "shadow DOM" limiting access to some components internal styling, html and events.
It's a big topic, hard to give you good advice. Try something and post errors you encounter, if any?
https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc.js_third_party_library

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?

How to add AngularJS in JSF page in intellijidea

I previously add "angular.min.js" into Intellij-idea for my projects that include JSP pages, but now i want to add agular into JSF page. When i add "angular.min.js" file "ng-app" and "ng-controller" are unknown by intellij! i don't know why, but i add lib and angular.js and when i type ng-app it was unknown by intellij and become red! Can anyone help me ?
I found the solution by add dependency in POM Files:
de.beyondjava
angularFaces-core
2.1.3
Some IDEs - like Netbeans and IntelliJ - try to verify your JSF very strictly. They know the list of "legal" JSF attributes from the taglib file provided by the component library (Mojarra, MyFaces, BootsFaces, PrimeFaces or AngularFaces). The difference between JSP and JSF is that JSP basically is already the final HTML code, while JSF generates the HTML code. So adding ng-app to one of the existing JSF components changes nothing. The attribute won't appear in the HTML code.
One solution is to add AngularFaces. Actually, this does a lot more than simply allowing you to add ng-app to JSF components. For instance, it converts <div> tags to first class citizens of JSF, which comes in handy in many situations.
If you need a less invasive solution, and if you're using JSF 2.2 or above, simply use pass-through attributes. They'll do the trick just as well. By the way, the implementation of AngularFaces does just that: it recognizes the attributes of AngularJS and converts them automatically to pass-through attributes.

How to run a validation check with Ionic

I have written an ionic application and would like to know how(if) i can validate the ionic app. Much like validating HTML with W3C.
Is there any way possible to run a validation check on the app.
I have tried to run the application in the browser and run a google chrome local html validation, however the directives are still visible and haven't been generated to html.
I don't believe there is a way to validate the Ionic HTML in the same way you validate the HTML in W3C validator.
however the directives are still visible and haven't been generated to html
Probably a bit of confusion here.
1. AngularJS directives will always be visible "as is" in the HTML code, they will not transform to anything. It's AngularJS itself to use them in its special way.
2. Ionic components are build with custom HTML tags, which means, for example will not transform to anything else. All Ionic custom tags are defined in ionic.css file.

Underscore.js template on Java server

I'm building a single page web app when Backbone.js is my MV* framework. It requires Underscore.js so I wan't to use it as my template engine.
I set the template result as the view content to display in it's render function:
this.el.append( compiledTemplate );
I wonder about the right way to implement the template code:
Should it be a JS code that produce an HTML text?
Should it be an HTML file with a script tag to include the JS code?
How can I separate the display from the logic?
How can I write my CSS in a separate file (not in JS file)?
Well... this is what the Underscore template engine is, isn't it? so, no, your template should be HTML with interpolate tags.
Normally it is a DOM element whose content is the template, and, yes, it is used to be a script tag.
Force your self to only use interpolate Model attributes in your templates. You can pass especial pre-calculated attributes if you use any kind of Decorator technique.
There is not any Backbone or Underscore restriction to you not include your external CSS files as usual.

Resources