0
votes

I have nested Angular directives like this:

<div d1>  
    <div d2></div>  
</div>  

It compiles as expected like :

  1. pre d1
  2. pre d2
  3. post d2
  4. post d1

Unfortunately, if I add a templateUrl reference to d2, the order of compilation changes to:

  1. pre d1
  2. post d1
  3. pre d2
  4. post d2

Why is it like this ?
Is there a way to use the first order when using templates ?

Thanks a lot in advance

1

1 Answers

0
votes

The template needs to compile its contents first to add it later to the node. That is why you see this order. Why you need this order?