0

I am working with a javascript Framework that wants custom attributs in the HTML... And Aptana shows this as invalid (underlined) with no description.. I'd like to add some of these, is it possible?

George Katsanos
  • 13,524
  • 16
  • 62
  • 98
  • 1
    I don't know Aptana but you should prefix [custom attributes](http://www.w3.org/html/wg/drafts/html/master/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes) with the prefix **data-** as such **data-my-attribute** to avoid future collisions. – kjetilh Feb 16 '13 at 18:24
  • I have no control over that, I'm using Angular which renders my templates.. – George Katsanos Feb 16 '13 at 19:02

2 Answers2

3

A quick fix to just stop the editor from displaying attribute warnings that I did was: Go to Windows > Preferences > Aptana Studio > Validation > HTML Tidy Validator > Attributes. Then set 'Proprietary Attributes' to ignore.

Nick Sotiros
  • 2,194
  • 1
  • 22
  • 18
0

You can prefix AngularJS attributes and also directives with data- and they will stil work. For example:

<body data-ng-app="app" >
    <div data-ng-controller="TestController">
        <span test-directive>
            {{test}}     
        </span>                        
    </div>        
</body>

Here is JSFiddle to check this out.

Think that way Aptana will treat attributes as valid but you'll have to verify that.


To manually add atributes, please look at this answer.

Community
  • 1
  • 1
PrimosK
  • 13,848
  • 10
  • 60
  • 78