There are several attributes which can be used during a new directive creation.
They include:
- Template: It describes an inline template as a string.
- Template URL: This attribute specifies the AngularJs HTML compiler to replace the custom directive inside a template with the HTML content located inside a separate file.
- Replace: It replaces the current element if the condition is true, if false append this directive to the current element.
- Transclude: It allows you to move the original children of a directive to a location inside the new template.
- Scope: It creates a new scope for this directive rather than inheriting the parent scope.
- Controller: It creates a controller which publishes an API for communicating across the directives.
- Require: It requires another directive to be present to function the current directive efficiently.
- Link: It modifies the resulting DOM element instances, adds event listeners, and set up data binding.
- Compile: It modifies the DOM template for features across copies of a directive, as when used in other directives. Your compile function can also return link functions to modify the resulting element instances.