Transclusion: $transcludeFn

For some time I was wondering what’s that $transcludeFn passed as last argument to AngularJS directive linking function. The documentation did not allow me to fully understand it. So I’ve taken a deep dive into implementation of ng-if, ng-include and ng-repeat directives (ng module built-in functionality). And it seems to be as simple as shooting one right down.

Continue reading

Directive Compilation in AngularJS – step-by-step

One of AngularJS core features is the possibility to teach the browser new HTML syntax. Its built-in HTML compiler allows developer to define new behavior for any HTML elements or their attributes. Creators have called these behavior extensions directives. To make better use of directives API and give them super powers we need to get an in-depth understanding of the compilation mechanism.

Continue reading