# Class StateBuilder

A internal global service

StateBuilder is a factory for the internal [[StateObject]] objects.

When you register a state with the [[StateRegistry]], you register a plain old javascript object which conforms to the [[StateDeclaration]] interface. This factory takes that object and builds the corresponding [[StateObject]] object, which has an API and is used internally.

Custom properties or API may be added to the internal [[StateObject]] object by registering a decorator function using the [[builder]] method.

- Defined in router/state/state-builder.js:264

#####
Index

### Constructors

constructor

### Properties

$injector
builders
matcher

### Methods

build
builder
name
parentName

##
Constructors

### constructor

- new StateBuilder(matcher, urlService): StateBuilder

- #### Parameters

  - matcher: any
  - urlService: any

  #### Returns StateBuilder

  - Defined in router/state/state-builder.js:265

##
Properties

### $injector

$injector: any

- Defined in router/state/state-builder.js:267

### builders

builders: {
data: ((state: any) => any)[];
includes: ((state: any) => any)[];
name: ((state: any) => any)[];
navigable: ((state: any) => any)[];
params: ((state: any) => any)[];
parent: ((state: any) => any)[];
path: ((state: any) => any)[];
resolvables: ((state: any) => any[])[];
self: ((state: any) => any)[];
url: ((stateObject: any) => any)[];
views: any[];
}

- Defined in router/state/state-builder.js:274

### matcher

matcher: any

- Defined in router/state/state-builder.js:266

##
Methods

### build

- build(state): any

- Builds all of the properties on an essentially blank State object, returning a State object which has all its properties and API built.

  #### Parameters

  - state: any

    an uninitialized State object

  #### Returns any

  the built State object

  - Defined in router/state/state-builder.js:313

### builder

- builder(name, fn): any

- #### Parameters

  - name: any
  - fn: any

  #### Returns any

  - Defined in router/state/state-builder.js:295

### name

- name(state): any

- #### Parameters

  - state: any

  #### Returns any

  - Defined in router/state/state-builder.js:351

### parentName

- parentName(state): any

- #### Parameters

  - state: any

  #### Returns any

  - Defined in router/state/state-builder.js:330