Code Monkey home page Code Monkey logo

Comments (8)

hippee-lee avatar hippee-lee commented on August 22, 2024

I thought htmlMin took care of the angular directives but looking in the dist folder I don't see it doing what I thought it did. @jedmao did you consider this plugin: https://www.npmjs.org/package/grunt-html-angular-validate ? Here is what caught my eye as better than the plugin you suggested:

  • Support for AngularJS attributes and tags (both from AngularJS and custom created)
  • Support for templated/fragmented HTML files

Out of the box it lets you validate with the W3C online validator tool. Which tool do we use for this currently? If we use it alot, we can always host the validator for ourselves. The value in using a tool we can tune to our product is that it will catch the specs as W3C interprets them and if you type data-ng-rrepeat="", the validator will catch it for us.

from method.

jednano avatar jednano commented on August 22, 2024

@hippee-lee I think you're right about htmlmin, but I don't see it working either and the documentation is lacking there.

The tool you mention looks nice, but it doesn't address this particular issue. Yes, it will validate, but it won't actually change the HTML. The tool I'm calling out will add the data- prefix to ng- attributes.

We should probably use both!

from method.

jednano avatar jednano commented on August 22, 2024

BTW, we were previously restricting all directives to be attributes so they would validate. Custom tags don't validate yet with HTML5.

I've seen a number of commits to refactor2 that introduce ng- attributes w/o the data- prefix. I'm just worried we'll have to filter through those validation errors. It's just noise.

from method.

hippee-lee avatar hippee-lee commented on August 22, 2024

Given that htmllmin isn't doing what I thought it was I'll audit the code base and address it with manual changes for now, shouldn't take to long.

Do you know if angular-html5 can be configured for our custom directive convention - vn-blah? Also, did you prefix your directives with data- when you named them in JavaScript?

from method.

jednano avatar jednano commented on August 22, 2024

@hippee-lee no, you don't need, nor is there a way to add a data- prefix to the JavaScript directive. Technically, they can initialize your directive with or without the data- prefix.

I'm with you on angular-html5 adding a feature for custom directives. That would be great, but from the documentation I've read, they only do, very simply, ng- attributes.

You might want to open up an issue on the project and see if the idea can get any traction? It's a good idea!

from method.

hippee-lee avatar hippee-lee commented on August 22, 2024

Actually it does, search for customPrefixes.
Do we know if this works with Grunt or, would we need to consider changing to Gulp? They have a link for Usage in build tools but there are ??'s after Grunt.

from method.

jednano avatar jednano commented on August 22, 2024

Changing to Gulp would be a huge undertaking at this point. 'Looks like there's a generator-gulp-angular though. When the time comes...

I guess we can't use this package w/o writing a Grunt plugin for now. It's not hard to write a Grunt plugin, but I'm not volunteering.

from method.

jednano avatar jednano commented on August 22, 2024

Closing this issue for now, but maybe we want to reopen it at some point.

from method.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.