How to add AngularJS in JSF page in intellijidea - angularjs

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.

Related

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 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.

Get Spring Form Action Attribute For Angular js

I'm trying to customize Jasig's CAS 4.0.0 to a new view using Angular 1.4. But i have a problem on this time, here i can't use the angular tags on the current <form:form> tag, and also i have no idea to extract the bean that,it uses to define the action=cas/login?... part. Here's what it uses:
The viewLogin.jsp that uses the form:
<form:form method="post" id="fm1" modelAttribute="${commandName}"htmlEscape="true" cssClass="form-validate mb-lg" novalidate="">
I again changed from commandName to modelAttribute, because i saw a question saying it was outdated... But i still haven't any idea how to extract the information which i need from that form. Apparently, that's just a name to instantiate a bean that is resolved by spring automatically. But how can i access that information outside of the JSP attribute? Also I want to make the validation from Angular to complete it, but since that i cannot extract the URL that CAS generates, I can't make it "totally works".
Thanks in advance!

How to use Angular JS on Web api result

I am just trying to connect MongoDB using Web api.
I followed steps present in
http://www.sunyingroup.com/web2012/mongapi.htm
I confused with step 3, Build Angular JS MVC Pattern .
My question is how/where to add Angularjs script present in the above mentioned website.
Looking into your link example, it uses MVC page but that page is not provided (they provided just the javascript code), but basically you can go with a pure html file where you define your grid to show the data, and add your button. you need to add ng-app directive to body tag of the html file with app named after their module name "CRUD", and include that code into a javascript tag, in the same file for example or separate file.
the following link gives you a starting point of how to use angularjs with API
http://www.codeproject.com/Articles/737030/A-basic-SPA-application-using-AngularJS-WebAPI-and
hope that helps.

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