Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions goldens/public-api/core/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,22 @@ export abstract class ComponentFactoryResolver {
abstract resolveComponentFactory<T>(component: Type<T>): ComponentFactory<T>;
}

// @public
export interface ComponentMirror<C> {
get inputs(): ReadonlyArray<{
readonly propName: string;
readonly templateName: string;
}>;
get isStandalone(): boolean;
get ngContentSelectors(): ReadonlyArray<string>;
get outputs(): ReadonlyArray<{
readonly propName: string;
readonly templateName: string;
}>;
get selector(): string;
get type(): Type<C>;
}

// @public
export abstract class ComponentRef<C> {
abstract get changeDetectorRef(): ChangeDetectorRef;
Expand Down Expand Up @@ -299,6 +315,14 @@ export interface ContentChildrenDecorator {
}): Query;
}

// @public
export function createComponent<C>(component: Type<C>, options: {
environmentInjector: EnvironmentInjector;
hostElement?: Element;
elementInjector?: Injector;
projectableNodes?: Node[][];
}): ComponentRef<C>;

// @public
export function createEnvironmentInjector(providers: Array<Provider | ImportedNgModuleProviders>, parent: EnvironmentInjector, debugName?: string | null): EnvironmentInjector;

Expand Down Expand Up @@ -1106,6 +1130,9 @@ export class QueryList<T> implements Iterable<T> {
toString(): string;
}

// @public
export function reflectComponentType<C>(component: Type<C>): ComponentMirror<C> | null;

// @public @deprecated
export abstract class ReflectiveInjector implements Injector {
abstract createChildFromResolved(providers: ResolvedReflectiveProvider[]): ReflectiveInjector;
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export * from './core_render3_private_export';
export {SecurityContext} from './sanitization/security';
export {Sanitizer} from './sanitization/sanitizer';
export {createNgModule, createNgModuleRef, createEnvironmentInjector} from './render3/ng_module_ref';
export {createComponent, reflectComponentType, ComponentMirror} from './render3/component';

import {global} from './util/global';
if (typeof ngDevMode !== 'undefined' && ngDevMode) {
Expand Down
4 changes: 1 addition & 3 deletions packages/core/src/linker/component_factory_resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@
* found in the LICENSE file at https://angular.io/license
*/

import {Injector} from '../di/injector';
import {Type} from '../interface/type';
import {stringify} from '../util/stringify';

import {ComponentFactory, ComponentRef} from './component_factory';
import {NgModuleRef} from './ng_module_factory';
import {ComponentFactory} from './component_factory';

export function noComponentFactoryError(component: Function) {
const error = Error(`No component factory found for ${
Expand Down
Loading