Get Spring Form Action Attribute For Angular js - angularjs

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!

Related

Having conflict with Django URL and Angular Route

I am currently working on a project using Django and Angular. I am trying to implement Django's Password-Reset app, which seems pretty easy to set up. I followed the instructions and I ran into a peculiar issue that is caused by Angular's routing. I am trying to link to a FormView using
Forgot password?
But it seems that Angular's routing keeps picking up the literal translation of the link
http://127.0.0.1:8000/%7B%%20url%20'password_reset_recover'%20%%7D
This of course causes a routing error to pop up.
Is there anyway I can link to this view without Angular interfering?
Looks like the problem is that Django is not parsing your URL tag in the template. Might want to look into that rather than into Angular
Could you check the a tag in your Developer tools and see what it says? Chances are that it says exactly what the URL is pointing to.i.e. /%7B%%20url%20'password_reset_recover'%20%%7D
Have you added password_reset_recover in your root urls.py?

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.

ASP.NET 5 vNext Forms Having Anti Forgery Tokens Added

I'm experiencing an issue where a simple form tag is having an action and method attribute added to it. Also added are some hidden input fields for what I am guessing is anti-forgery.
Here is the html I'm adding in the Razor View:
<form>test</form>
And here's what's being rendered:
<form action="/company/adduser" method="post" class="ng-pristine ng-valid">
test
<input name="__RequestVerificationToken" type="hidden" value="CfDJ8KMbFT4ebnROrEREXkL-MYlPSgL0ISe6_sqTJXc982ocoWgKH1v_yCV2_5Qa9h8AmVFaNk0i0Wpa6gQlhWY-PHkZ929_Tkv1B-lCR7-aLyd53L2448CLQNtakb-UHQmLgPGCiQF0dj4jij9lc_sS7jRPjcGFnNjxdT_wobz-CsU3NvR-fm-a9r0MnqhflgwLLw">
</form>
It's causing major issues since I'm only using asp.net MVC to serve up HTML and using AngularJS on the client. The action methods is causing issues with angular when trying to use ng-submit.
Does anyone know:
Is MVC somehow automatically adding anti-forgery tokens?
How do I disable this?
As of the time of this writing, that's just a bug in the Form tag helper. It will be fixed.
You can exclude Form (or any element) from taghelper processing by adding a ! as in <!form></!form>
Problem here is that Microsoft added new TagHelpers and one of them is <form>. It seems to be adding all that extra "stuff".
Edit and better fix:
I ended up configuring TagHelpers to have a prefix. In my _GlobalImport.cshtml I added:
#addTagHelper "*, Microsoft.AspNet.Mvc.TagHelpers"
#tagHelperPrefix "asp:"
This allowed me to add "asp:" in front of any TagHelpers I did want to render. This also prevented the <form> tags from being rendered by the TagHelper.
I was notified by Damien Edwards on the ASP.NET team at Microsoft that the issue with the form tag is a bug and will be fixed. I still thought this information would be helpful in the meantime.
You can also prevent a TagHelper from rendering by adding a ! in front like so: <!form></!form>

How can I create growl notifcation in angularjs that accepts html as message

I want to show growl type notification in my angularJS app (using timer) and use that technique to throw small surveys to user. For that this seems to be a good choice - https://github.com/marcorinck/angular-growl/ - with a catch. This doesn't seem to support HTML TAGS.
Any idea how I can achieve that in simple way ?
Thanks in advance
Latest version of angular-growl does support HTML as part of the message.
growl-like notifications for angularJS with HTML as part of the message
Just a follow up answer, it seems that the original angular-growl is outdated.
A fork has been made it seems that is activelly maintained at https://github.com/JanStevens/angular-growl-2.
Per README.md file:
Allows for HTML content inside the alert

Resources