# 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 src/router/state/state-builder.js:265

##### Index

### Constructors

constructor

### Properties

$injector
builders
matcher

### Methods

build
builder
name
parentName

## Constructors

### constructor

- new StateBuilder(matcher: any, urlService: any): StateBuilder

  #### Parameters

  - matcher: any
  - urlService: any

  #### Returns StateBuilder

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

## Properties

### $injector

$injector: any

- Defined in src/router/state/state-builder.js:268

### 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 src/router/state/state-builder.js:275

### matcher

matcher: any

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

## Methods

### build

- build(state: any): 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 src/router/state/state-builder.js:314

### builder

- builder(name: any, fn: any): any

  #### Parameters

  - name: any
  - fn: any

  #### Returns any

  - Defined in src/router/state/state-builder.js:296

### name

- name(state: any): any

  #### Parameters

  - state: any

  #### Returns any

  - Defined in src/router/state/state-builder.js:352

### parentName

- parentName(state: any): any

  #### Parameters

  - state: any

  #### Returns any

  - Defined in src/router/state/state-builder.js:331