DomSanitizer

Stable Security Risk Class Security Risk Calling any of the bypassSecurityTrust... APIs disables Angular's built-in sanitization for the value passed in. Carefully check and audit all values and code paths going into this call. Make sure any user data is appropriately escaped for this security context. For more detail, see the Security Guide. Class Overview class DomSanitizer { sanitize(context: SecurityContext, value: any) : string bypassSecurityTrustHtml(value: string) : SafeHtml

AnimationStateMetadata

Experimental Class Class Overview class AnimationStateMetadata { } Class Description exported from @angular/core/index, defined in @angular/core/src/animation/metadata.ts

Hierarchical Injectors

Angular's hierarchical dependency injection system supports nested injectors in parallel with the component tree. We learned the basics of Angular Dependency injection in the Dependency Injection chapter. Angular has a Hierarchical Dependency Injection system. There is actually a tree of injectors that parallel an application's component tree. We can reconfigure the injectors at any level of that component tree with interesting and useful results. In this chapter we explore these points and wri

SlicePipe

Stable Pipe What it does Creates a new List or String containing a subset (slice) of the elements. How to use array_or_string_expression | slice:start[:end] NgModuleCommonModule Description Where the input expression is a List or String, and: start: The starting index of the subset to return. a positive integer: return the item at start index and all items after in the list or string expression. a negative integer: return the item at start index from the end and all items after in th

EVENT_MANAGER_PLUGINS

Stable Const Variable Export export EVENT_MANAGER_PLUGINS exported from @angular/platform-browser/index defined in @angular/platform-browser/src/dom/events/event_manager.ts

withModule()

Experimental Function Class Export export withModule(moduleDef: TestModuleMetadata) : InjectSetupWrapper exported from @angular/core/testing/index defined in @angular/core/testing/test_bed.ts

Ahead-of-Time Compilation

Learn how to use Ahead-of-time compilation This cookbook describes how to radically improve performance by compiling Ahead of Time (AoT) during a build process. Table of Contents Overview Ahead-of-Time vs Just-in-Time Compile with AoT Bootstrap Tree Shaking Load the bundle Serve the app Source Code Overview Angular component templates consist of a mix of standard html and Angular syntax (e.g. ngIf, ngFor). Expressions like ngIf and ngFor are specific to Angular. The browser cannot execute th

EventManager

Stable Class Class Overview class EventManager { constructor(plugins: EventManagerPlugin[], _zone: NgZone) addEventListener(element: HTMLElement, eventName: string, handler: Function) : Function addGlobalEventListener(target: string, eventName: string, handler: Function) : Function getZone() : NgZone } Class Description Annotations @Injectable() Constructor constructor(plugins: EventManagerPlugin[], _zone: NgZone) Class Details addEventListener(element: HTMLElement, event

forms

Module Entry point for all public APIs of the forms package. AbstractControl AbstractControlDirective AbstractFormGroupDirective AsyncValidatorFn CheckboxControlValueAccessor ControlContainer ControlValueAccessor DefaultValueAccessor Form FormArray FormArrayName FormBuilder FormControl FormControlDirective FormControlName FormGroup FormGroupDirective FormGroupName FormsModule MaxLengthValidator MinLengthValidator NG_ASYNC_VALIDATORS NG_VALIDATORS NG_VALUE_ACCESSOR NgControl NgControlStatus NgCo

CanDeactivate

Stable Interface What it does Indicates that a class can implement to be a guard deciding if a route can be deactivated. How to use class UserToken {} class Permissions { canDeactivate(user: UserToken, id: string): boolean { return true; } } @Injectable() class CanDeactivateTeam implements CanDeactivate<TeamComponent> { constructor(private permissions: Permissions, private currentUser: UserToken) {} canDeactivate( component: TeamComponent, route: ActivatedRouteS