# Class ViewConfig

- Defined in src/router/state/views.js:94

##### Index

### Constructors

constructor

### Properties

$id
component
controller
factory
getTemplate
loaded
path
template
viewDecl

### Methods

getController
load
normalizeUIViewTarget

## Constructors

### constructor

- new ViewConfig(
  path: PathNode[],
  viewDecl: any,
  factory: TemplateFactoryProvider,
  ): ViewConfig

  #### Parameters

  - path: PathNode[]
  - viewDecl: any
  - factory: TemplateFactoryProvider

  #### Returns ViewConfig

  - Defined in src/router/state/views.js:100

## Properties

### $id

$id: number

- Defined in src/router/state/views.js:107

### component

component: any

- Defined in src/router/state/views.js:104

### controller

controller: any

- Defined in src/router/state/views.js:132

### factory

factory: TemplateFactoryProvider

- Defined in src/router/state/views.js:103

### getTemplate

getTemplate: (ngView: any, context: any) => any

- Defined in src/router/state/views.js:109

### loaded

loaded: boolean

- Defined in src/router/state/views.js:108

### path

path: PathNode[]

- Defined in src/router/state/views.js:101

### template

template: any

- Defined in src/router/state/views.js:105

### viewDecl

viewDecl: any

- Defined in src/router/state/views.js:102

## Methods

### getController

- getController(context: any): Function | Promise<Function>

  Gets the controller for a view configuration.

  #### Parameters

  - context: any

  #### Returns Function | Promise<Function>

  Returns a controller, or a promise that resolves to a controller.

  - Defined in src/router/state/views.js:142

### load

- load(): Promise<ViewConfig>

  #### Returns Promise<ViewConfig>

  - Defined in src/router/state/views.js:120

### `Static` normalizeUIViewTarget

- normalizeUIViewTarget(
  context: any,
  rawViewName?: string,
  ): { ngViewContextAnchor: string; ngViewName: string }

  Normalizes a view's name from a state.views configuration block.

  This should be used by a framework implementation to calculate the values for [[_ViewDeclaration.$ngViewName]] and [[_ViewDeclaration.$ngViewContextAnchor]].

  #### Parameters

  - context: any

    the context object (state declaration) that the view belongs to

  - rawViewName: string = ""

    the name of the view, as declared in the [[StateDeclaration.views]]

  #### Returns { ngViewContextAnchor: string; ngViewName: string }

  the normalized ngViewName and ngViewContextAnchor that the view targets

  - Defined in src/router/state/views.js:162