MockViewResolver

export class MockViewResolver

exported from angular2/testing defined in angular2/src/mock/view_resolver_mock.ts (line 7)

Annotations

@Injectable()

Constructor

constructor()

Not Yet Documented

Members

setView(component: Type, view: ViewMetadata) : void

Overrides the ViewMetadata for a component.

setInlineTemplate(component: Type, template: string) : void

Overrides the inline template for a component - other configuration remains unchanged.

overrideViewDirective(component: Type, from: Type, to: Type) : void

Overrides a directive from the component ViewMetadata.

resolve(component: Type) : ViewMetadata

Returns the ViewMetadata for a component:

  • Set the ViewMetadata to the overridden view when it exists or fallback to the default ViewResolver, see setView.
  • Override the directives, see overrideViewDirective.
  • Override the @View definition, see setInlineTemplate.