UNPKG

angular2

Version:

Angular 2 - a web framework for modern web apps

41 lines (40 loc) 1.44 kB
import { Type } from 'angular2/src/facade/lang'; import { ViewMetadata } from '../core/metadata'; import { ViewResolver } from 'angular2/src/compiler/view_resolver'; export declare class MockViewResolver extends ViewResolver { constructor(); /** * Overrides the {@link ViewMetadata} for a component. * * @param {Type} component * @param {ViewDefinition} view */ setView(component: Type, view: ViewMetadata): void; /** * Overrides the inline template for a component - other configuration remains unchanged. * * @param {Type} component * @param {string} template */ setInlineTemplate(component: Type, template: string): void; /** * Overrides a directive from the component {@link ViewMetadata}. * * @param {Type} component * @param {Type} from * @param {Type} to */ overrideViewDirective(component: Type, from: Type, to: Type): void; /** * Returns the {@link ViewMetadata} for a component: * - Set the {@link 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`. * * @param component * @returns {ViewDefinition} */ resolve(component: Type): ViewMetadata; }