Yameen
Yameen

Reputation: 585

Can we use angular with HTML4?

I am new to Angular and since Angular.JS uses directives which are a kind of data-* attributes and data-* attributes are new to HTML5. So in that case is AngularJS HTML5 specific or are there any tweaks to make it run on older version as well.

Please Correct me if my understanding is mismatching somewhere.

Upvotes: 1

Views: 1568

Answers (2)

Patrick Hofman
Patrick Hofman

Reputation: 157048

There isn't really one spec for HTML5 (it is an continuously changing spec), so it is hard to say when a browser is HTML4 or HTML5.

The current version should run fine on IE9 and onwards, which is in my opinion a more 'HTML4' browser, than a 'HTML5' one.

See the AngularJS IE compatibility page for more info.

Upvotes: 0

Quentin
Quentin

Reputation: 944005

You can stick Angular directives in an HTML 4 document and it will "work". It just won't be a valid HTML 4 document, which will make using a markup validator as part of your QA process much more difficult.

There aren't very many cases where adding Angular to a document will be a small change, so you are probably best off moving to HTML 5 at the same time.

Upvotes: 2

Related Questions