I want to delay compiling child directive until a promise in parent directive's prelink will be resolved and value (CONFIG) will be overwritten.
In Parent's preLink:
somePromise.then(function(){
CONFIG = 1;
elem.append($compile(template)(scope));
}
Template contains Child directive, so Child's prelink is executing after promise's resolve. Now I want to access CONFIG in Child's prelink and it has old value ({}).
Why is it happening? Fiddle: http://jsfiddle.net/RmDuw/642/