2

I’m trying to use UI Bootstrap’s inline datepicker, but it works with a custom tag:

<datepicker ng-model="dt" min-date="minDate"></datepicker>

My template processor doesn’t support custom tags, is there a way to have this working with a standard tag, e.g. something like <div ng-something="datepicker"></div>?

There have been discussions on how/why AngularJS uses custom tags here and here, and AngularJS has some doc on how make IE8 accept custom tags using JS, but my problem is at the HTML generation step, i.e. it’s not a problem with the browser.

Note that I can’t change my template processor, and this question is larger than that since you have to use standard tags if you want to have a W3C-compliant HTML. AngularJS lets you use standard attributes (by prepending data-), but I can’t find a way to use standard tags.

1 Answer 1

3

You may try something along these lines:

<div data-datepicker ng-model="dt" min-date="minDate"></div>

EDIT: It should work, as the datepicker directive from ui-bootstrap (https://github.com/angular-ui/bootstrap/blob/master/src/datepicker/datepicker.js) seems to have restrict attribute set to 'EA', which means, that you can use it by Element or Attribute. So I think you're good to go with my example provided above.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.