Page 1 of 1

AngularJS

Posted: Fri May 09, 2014 10:32 am
by Albert Wiersch
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'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.

Re: AngularJS

Posted: Sun May 11, 2014 2:31 pm
by rss245cse
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

Re: AngularJS

Posted: Sun May 11, 2014 4:03 pm
by Albert Wiersch
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.

Re: AngularJS

Posted: Mon May 19, 2014 8:17 am
by Albert Wiersch
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!