2

Is it possible to have two different directives on the same HTML element?

<div directiveone directivetwo></div>

or will that cause scope issues?

1 Answer 1

7

Yes you can and it's fairly common. The only potential issue with scope is you can't have multiple new scopes on the same element. Per the angular docs: "If multiple directives on the same element request a new scope, only one new scope is created." http://docs.angularjs.org/guide/directive

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

4 Comments

What if I have directivetwo in the HTML for the template for directiveone?
Instead of on the original div? Or also?
Inside the original div
Do you have an example of what you'd like to do? It really depends on the specifics.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.