ComponentFixture

Stable Class Class Overview class ComponentFixture { constructor(componentRef: ComponentRef<T>, ngZone: NgZone, _autoDetect: boolean) debugElement : DebugElement componentInstance : T nativeElement : any elementRef : ElementRef changeDetectorRef : ChangeDetectorRef componentRef : ComponentRef<T> ngZone : NgZone detectChanges(checkNoChanges?: boolean) : void checkNoChanges() : void autoDetectChanges(autoDetect?: boolean) isStable() : boolean whenSta

ComponentFactoryResolver

Stable Class Class Overview class ComponentFactoryResolver { staticNULL : ComponentFactoryResolver resolveComponentFactory(component: Type<T>) : ComponentFactory<T> } Class Description Static Members NULL : ComponentFactoryResolver Class Details resolveComponentFactory(component: Type<T>) : ComponentFactory<T> exported from @angular/core/index, defined in @angular/core/src/linker/component_factory_resolver.ts

ComponentFactory

Stable Class Class Overview class ComponentFactory { constructor(selector: string, _viewFactory: Function, _componentType: Type<any>) C selector : string componentType : Type<any> create(injector: Injector, projectableNodes?: any[][], rootSelectorOrNode?: string|any) : ComponentRef<C> } Class Description Constructor constructor(selector: string, _viewFactory: Function, _componentType: Type<any>) Class Details C selector : string componentType :

Component-relative Paths

Use relative URLs for component templates and styles. Write Component-Relative URLs to component templates and style files Our components often refer to external template and style files. We identify those files with a URL in the templateUrl and styleUrls properties of the @Component metadata as seen here: @Component({ selector: 'absolute-path', templateUrl: 'app/some.component.html', styleUrls: ['app/some.component.css'] }) By default, we must specify the full path back to the applicat

Component Styles

Learn how to apply CSS styles to components. Angular 2 applications are styled with regular CSS. That means we can apply everything we know about CSS stylesheets, selectors, rules, and media queries to our Angular applications directly. On top of this, Angular has the ability to bundle component styles with our components enabling a more modular design than regular stylesheets. In this chapter we learn how to load and apply these component styles. Table Of Contents Using Component Styles Specia

Component Interaction

Share information between different directives and components This cookbook contains recipes for common component communication scenarios in which two or more components share information. Table of contents Pass data from parent to child with input binding Intercept input property changes with a setter Intercept input property changes with ngOnChanges Parent listens for child event Parent interacts with child via a local variable Parent calls a ViewChild Parent and children communicate via a se

COMPILER_OPTIONS

Experimental Const Variable Export export COMPILER_OPTIONS Token to provide CompilerOptions in the platform injector. exported from @angular/core/index defined in @angular/core/src/linker/compiler.ts

CompilerOptions

Experimental Type-alias Interface Overview interface CompilerOptions { } Interface Description Options for creating a compiler exported from @angular/core/index, defined in @angular/core/src/linker/compiler.ts

CompilerFactory

Experimental Class Class Overview class CompilerFactory { createCompiler(options?: CompilerOptions[]) : Compiler } Class Description A factory for creating a Compiler Class Details createCompiler(options?: CompilerOptions[]) : Compiler exported from @angular/core/index, defined in @angular/core/src/linker/compiler.ts

Compiler

Stable Class Class Overview class Compiler { compileModuleSync(moduleType: Type<T>) : NgModuleFactory<T> compileModuleAsync(moduleType: Type<T>) : Promise<NgModuleFactory<T>> compileModuleAndAllComponentsSync(moduleType: Type<T>) : ModuleWithComponentFactories<T> compileModuleAndAllComponentsAsync(moduleType: Type<T>) : Promise<ModuleWithComponentFactories<T>> clearCache() : void clearCacheFor(type: Type<any>) }