0

I am starting with angular and I often see two different approaches of using a module:

<input autocomplete options="..."/>

And:

<autocomplete options="..."/>

I think the first one is a better options since it uses the native HTML tags.

Is there a reason, or advantage of using the second approach?

In my opinion the HTML code becomes quite strange ...

2
  • possible duplicate of Angular directives - element or attribute? Commented Jan 15, 2015 at 14:18
  • 1
    It's one of the Angular's strengths - to make the HTML "readable". You can actually see what the DOM element's specific function is. In my opinion choosing between element or attribute is about what it's for, if it's a div you may want it to be an element, but for input then perhaps attribute is most transparent. Commented Jan 15, 2015 at 14:47

0

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.