# Interface Directive

Defines the structure of an AngularJS directive.

interface Directive {
$$addStateInfo?: (...args: any[]) => any;
bindToController?: boolean | Record<string, string>;
compile?: DirectiveCompileFn;
controller?: any;
controllerAs?: string;
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?: boolean | Record<string, string> | "element";
}

- Defined in src/interface.ts:206

##### Index

### Properties

$$addStateInfo?
bindToController?
compile?
controller?
controllerAs?
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

- Defined in src/interface.ts:240

### `Optional` bindToController

bindToController?: boolean | Record<string, string>

Whether to bind scope to controller

- Defined in src/interface.ts:218

### `Optional` compile

compile?: DirectiveCompileFn

Compile function for the directive

- Defined in src/interface.ts:212

### `Optional` controller

controller?: any

Controller constructor or injectable string name

- Defined in src/interface.ts:214

### `Optional` controllerAs

controllerAs?: string

Alias name for the controller in templates

- Defined in src/interface.ts:216

### `Optional` link

link?: DirectivePrePost | DirectiveLinkFn

Link function(s) executed during linking

- Defined in src/interface.ts:220

### `Optional` name

name?: string

Optional name (usually inferred)

- Defined in src/interface.ts:208

### `Optional` priority

priority?: number

Priority of the directive

- Defined in src/interface.ts:222

### `Optional` replace

replace?: boolean

Replaces the element with the template if true

- Defined in src/interface.ts:226

### `Optional` require

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

Required controllers for the directive

- Defined in src/interface.ts:228

### `Optional` restrict

restrict?: string

Restict option: 'A' and/or 'E'

- Defined in src/interface.ts:210

### `Optional` scope

scope?: boolean | Record<string, string>

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

- Defined in src/interface.ts:230

### `Optional` template

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

Inline template

- Defined in src/interface.ts:232

### `Optional` templateNamespace

templateNamespace?: string

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

- Defined in src/interface.ts:234

### `Optional` templateUrl

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

Template URL for loading from server

- Defined in src/interface.ts:236

### `Optional` terminal

terminal?: boolean

Stops further directive processing if true

- Defined in src/interface.ts:224

### `Optional` transclude

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

Enables transclusion or configures named slots

- Defined in src/interface.ts:238