I think I understand. I was just confused because ng-if worked in the same file.

I think that ng-if will remove an element that you will want to bind to in the link function of the directive. Wouldn't checking for existence in the link function (before binding) help?