AngularJS

For technical support for all editions of CSS HTML Validator. Includes bug reports.
Post Reply
User avatar
Albert Wiersch
Site Admin
Site Admin
Posts: 3412
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

AngularJS

Post by Albert Wiersch » Fri May 09, 2014 10:32 am

Are there any developers here using AngularJS and wanting to validate AngularJS documents in CSE HTML Validator Pro+ without a lot of false positives?

You can easily program CSE HTML Validator Pro+ ignore attributes starting with "ns-" using the following custom user functions:

Code: Select all

function onUnknownAttributeMessage() {
 if beginsWithCase($ouam_attname,"ng-") {
  $ouam_msgflags=0; // cancel message
  $AngularJSAttributesIgnoredCount++;
 }
}

function onEndedValidation() {
 if isSet($AngularJSAttributesIgnoredCount) {
  if $AngularJSAttributesIgnoredCount>0 {
   MessageEx(13,2014050900,MSG_COMMENT,'AngularJS attributes ignored: '+$AngularJSAttributesIgnoredCount);
  }
 }
}
Just put the above in a text file, like CSEAngularJS.cfg and then in the Validator Engine Options (Ctrl+F4), Validator Engine->Config File page specify the filename in one of the 'User functions' fields and reload the configuration.

I've incorporated this into the online edition of the validator:
http://www.OnlineWebCheck.com/

I'd also appreciate anyone's thoughts on improving support for AngularJS in the future. For example, should it be built-in? I'd also like to know how many here use it.
Image
Albert Wiersch

rss245cse
Rank 0 - Newcomer
Rank 0 - Newcomer
Posts: 1
Joined: Sun May 11, 2014 2:00 pm

Re: AngularJS

Post by rss245cse » Sun May 11, 2014 2:31 pm

Yes this change helped me out a lot and at least now I intend to work with the technology!
Perhaps other will be using it as well.

I placed the file like so which I believe is correct your email did not work exactly right see my pic below:
Which I got to by clicking on: Options >> Validate Engine Options >> Options
then on the left column select Config File

finally enter the path to the cseAngularJS.cfg file as a User Functions file
csehtmlss1.png
If the image tag does not work this is the image intended
csehtmlss1.png (70.16 KiB) Viewed 4922 times

User avatar
Albert Wiersch
Site Admin
Site Admin
Posts: 3412
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

Re: AngularJS

Post by Albert Wiersch » Sun May 11, 2014 4:03 pm

Hello,

Great! I'm glad it was helpful.

Thanks for the screenshot. That looks correct... just don't forget to reload the configuration for the changes to go into effect.
Image
Albert Wiersch

User avatar
Albert Wiersch
Site Admin
Site Admin
Posts: 3412
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

Re: AngularJS

Post by Albert Wiersch » Mon May 19, 2014 8:17 am

Help test AngularJS support!

Please send me a private message or contact me at support at htmlvalidator dot com if you use AngularJS and would like to help test new AngularJS support in an upcoming release of CSE HTML Validator. Thanks!
Image
Albert Wiersch

Post Reply