Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I keep seeing "pure html templates" in many comments about AngularJS, but they don't seem to be completely "pure" from my perspective. Couple of questions for you...

1. AngularJS directives do not seem to conform to valid HTML. Does this matter to Google from a search perspective? I realize that single-page applications quite often have other SEO problems, but valid non DSL HTML templates seem like they would be of value for all the reasons you outline above.

2. I quite often see the following type of examples in an AngularJS tutorials. How is this different from Handlebars or Mustache? This still ties my template directly to AngularJS, no? Also, this is usually not understood by designers tools.

    <pane title="Localization">
        Date: {{ '2012-04-01' | date:'fullDate' }} <br>
        Currency: {{ 123456 | currency }} <br>
        Number: {{ 98765.4321 | number }} <br>
    </pane>
Not saying JSON templates are better; they look extremely hard to maintain. The Transparency project (http://leonidas.github.io/transparency/) does work with pure HTML templates, but it is just a rendering engine and not part of a larger framework.


1. Angular directives CAN but are not required to conform to valid HTML. All directives can be declared in HTML via a data-ng-xxx attribute if your app needs to maintain valid HTML.

2. All templates are tied to a compiler - there's really no getting around that. I'd have to disagree that that format is imcomprehensible to non technical designers, especially when compared to purely JS options.

That said, it's perfectly reasonable to rewrite that template as follows (which should play more nicely with existing tools):

    <pane title="Localization"
        data-pane-date="2012-04-01"
        data-pane-date-format="fullDate"
        data-pane-currency="123456"
        data-pane-number="98765.4321" />




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: