# Interface Directive

Defines the structure of an AngularTS directive.

interface Directive {
$$addStateInfo?: (...args: any[]) => any;
bindToController?: boolean | Record<string, string>;
compile?: DirectiveCompileFn;
controller?: any;
controllerAs?: string;
count?: number;
link?: DirectivePrePost | DirectiveLinkFn;
name?: string;
priority?: number;
replace?: boolean;
require?: string | string[] | Record<string, string>;
restrict?: string;
scope?: boolean | Record<string, string>;
template?: string | ((element: Element, attrs: Attributes) => string);
templateNamespace?: string;
templateUrl?: string | ((element: Element, attrs: Attributes) => string);
terminal?: boolean;
transclude?: string | boolean | Record<string, string>;
}

##### Index

### Properties

$$addStateInfo?
bindToController?
compile?
controller?
controllerAs?
count?
link?
name?
priority?
replace?
require?
restrict?
scope?
template?
templateNamespace?
templateUrl?
terminal?
transclude?

## Properties

### `Optional`$$addStateInfo

$$addStateInfo?: (...args: any[]) => any

Internal hook for directive compilation state

### `Optional` bindToController

bindToController?: boolean | Record<string, string>

Whether to bind scope to controller

### `Optional` compile

compile?: DirectiveCompileFn

Compile function for the directive

### `Optional` controller

controller?: any

Controller constructor or injectable string name

### `Optional` controllerAs

controllerAs?: string

Alias name for the controller in templates

### `Optional` count

count?: number

### `Optional` link

link?: DirectivePrePost | DirectiveLinkFn

Link function(s) executed during linking

### `Optional` name

name?: string

Optional name (usually inferred)

### `Optional` priority

priority?: number

Priority of the directive

### `Optional` replace

replace?: boolean

Replaces the element with the template if true

### `Optional` require

require?: string | string[] | Record<string, string>

Required controllers for the directive

### `Optional` restrict

restrict?: string

Restrict option: 'A' and/or 'E'. Defaults to 'EA'

### `Optional` scope

scope?: boolean | Record<string, string>

Scope configuration (`true`, `false`, or object for isolate scope)

### `Optional` template

template?: string | ((element: Element, attrs: Attributes) => string)

Inline template

### `Optional` templateNamespace

templateNamespace?: string

Template namespace (e.g., SVG, HTML)

### `Optional` templateUrl

templateUrl?: string | ((element: Element, attrs: Attributes) => string)

Template URL for loading from server

### `Optional` terminal

terminal?: boolean

Stops further directive processing if true

### `Optional` transclude

transclude?: string | boolean | Record<string, string>

Enables transclusion or configures named slots