0% found this document useful (0 votes)
14 views11 pages

Angular Interview Questions 2

The document provides a comprehensive overview of Angular concepts, including directives, services, data binding, forms, and routing. It covers both basic and advanced topics, suitable for developers with 4-5 years of experience. Additionally, it includes practical scenarios and explanations of Angular's features like change detection, dependency injection, and lifecycle hooks.

Uploaded by

aanifjamal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views11 pages

Angular Interview Questions 2

The document provides a comprehensive overview of Angular concepts, including directives, services, data binding, forms, and routing. It covers both basic and advanced topics, suitable for developers with 4-5 years of experience. Additionally, it includes practical scenarios and explanations of Angular's features like change detection, dependency injection, and lifecycle hooks.

Uploaded by

aanifjamal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 11

Explain the difference between ng-template, ng-container, and ng-content.

Answer:
ng-template is used to define a template that can be reused and referenced within
the view. It does not render any actual DOM element.
ng-container is a grouping element that does not render any additional DOM element.
It is used to apply structural directives without introducing extra DOM nodes.
ng-content is used for content projection, allowing you to insert dynamic content
into a component's template.
How does Angular's change detection mechanism work?

Answer: Angular's change detection mechanism checks the component tree to see if
the model has changed and updates the view accordingly. It uses a zone to detect
when asynchronous operations (like HTTP requests) have completed, triggering change
detection. Change detection can be configured using Default and OnPush strategies.
The OnPush strategy improves performance by only checking components when their
inputs change.
What is a resolver in Angular, and how would you use it?

Answer: A resolver is a service that resolves data before a route is activated. It


is used to fetch data from a backend service and ensure that the data is available
before the component is loaded. You use it by implementing the Resolve interface
and adding it to the route's resolve property.
What are Angular animations, and how do you implement them?

Answer: Angular animations are used to add dynamic effects to the components and
elements in an application. They are defined using the @angular/animations module.
You create animations using the trigger, state, style, animate, and transition
functions and apply them with the @Component decorator's animations property.
How would you implement a custom directive in Angular?

Answer: To implement a custom directive, create a new class and decorate it with
the @Directive decorator. Define the selector for the directive, and use the
ElementRef and Renderer2 services to manipulate the DOM as needed. You can also use
@Input to pass data to the directive.
What are Angular pipes, and how do you create a custom pipe?

Answer: Angular pipes are used to transform data in templates. To create a custom
pipe, create a new class and decorate it with the @Pipe decorator, providing a
unique name. Implement the PipeTransform interface and define the transform method
to specify the transformation logic.
Scenario-Based Questions
How would you handle authentication and authorization in an Angular application?

Answer: Authentication can be handled using services to manage login and token
storage, typically with JWT tokens. Authorization is implemented using route guards
(CanActivate, CanLoad, etc.) to restrict access to routes based on user roles or
permissions. Additionally, you can use interceptors to attach tokens to HTTP
requests.
How do you perform unit testing and end-to-end (E2E) testing in Angular?

Answer:
Unit testing in Angular is done using the Jasmine framework and the Karma test
runner. Angular CLI provides commands to generate and run tests for components,
services, and other parts of the application.
End-to-end testing is performed using the Protractor framework. It allows for
testing the application's functionality by simulating user interactions with the
UI.
How would you implement internationalization (i18n) in an Angular application?
Answer: Internationalization in Angular can be implemented using the
@angular/localize package. You can mark text for translation using the i18n
attribute in templates, generate translation files, and then use the Angular CLI to
compile the application for different locales.
Conceptual Questions
What are Angular Elements, and when would you use them?

Answer: Angular Elements allow you to create custom elements (web components) using
Angular. These elements can be used in any HTML page, regardless of whether the
page is an Angular application. They are useful for embedding Angular components in
non-Angular projects or sharing components across different frameworks.
How does Angular handle dependency injection with hierarchical injectors?

Answer: Angular's dependency injection system is hierarchical, meaning each


injector can create its own child injectors. This allows for different instances of
a service in different parts of the application. Services provided in a module are
available to all its components, whereas services provided in a component are
scoped to that component and its children.
Explain the concept of tree-shakable providers in Angular.

Answer: Tree-shakable providers are a feature that allows services to be included


in the application's bundle only if they are actually used. This is achieved by
providing services at the root level using the providedIn property in the
@Injectable decorator. This reduces the final bundle size by eliminating unused
services.
These additional questions and answers delve deeper into Angular's advanced
concepts and practical scenarios, providing a well-rounded understanding suitable
for a developer with 4-5 years of experience.

give more basic

ChatGPT
Certainly! Here are more basic interview questions and answers on Angular for
someone with 4-5 years of experience:

Basic Technical Questions


What is Angular and how does it differ from AngularJS?

Answer: Angular is a platform and framework for building single-page client


applications using HTML and TypeScript. Angular is a complete rewrite of AngularJS
(Angular 1.x), offering a more modular architecture, improved performance, and the
use of TypeScript instead of JavaScript.
What is TypeScript and why is it used in Angular?

Answer: TypeScript is a superset of JavaScript that includes static typing and


other features to help with large-scale application development. It is used in
Angular because it provides better tooling, enhanced code readability, and helps
prevent many common JavaScript errors through type checking.
Explain the purpose of Angular CLI.

Answer: Angular CLI (Command Line Interface) is a tool that helps automate common
tasks when building Angular applications, such as creating a new project,
generating components, services, and other code scaffolding, running tests, and
serving the application. It improves developer productivity by providing a standard
structure and workflow.
What is a component in Angular?

Answer: A component is the basic building block of an Angular application. It


consists of an HTML template, a TypeScript class, and CSS styles. Components are
used to create views, and each component can encapsulate its own logic and view.
What is a directive in Angular?

Answer: A directive is a class that adds behavior to elements in Angular


applications. There are three types of directives: component directives, structural
directives (like *ngIf and *ngFor), and attribute directives (like ngClass and
ngStyle).
What is Angular's data binding and how does it work?

Answer: Data binding in Angular is a mechanism to synchronize the data between the
model (TypeScript code) and the view (HTML template). There are four forms of data
binding: interpolation (one-way from data source to view), property binding (one-
way from data source to view), event binding (one-way from view to data source),
and two-way binding (using [(ngModel)]).
What is the purpose of Angular services?

Answer: Services in Angular are used to encapsulate business logic and data access.
They help in sharing data and functionality across components. Services are
typically used for tasks like fetching data from an API, managing state, or
performing calculations.
What are Angular lifecycle hooks?

Answer: Lifecycle hooks are methods that Angular calls at specific points in a
component's lifecycle. Some common lifecycle hooks include:
ngOnInit(): Called once the component has initialized.
ngOnChanges(): Called when any data-bound input property changes.
ngOnDestroy(): Called just before the component is destroyed.
What is Angular routing?

Answer: Angular routing allows navigation between different views or components. It


is implemented using the RouterModule and configured with route definitions.
Angular's router supports features like lazy loading, route guards, and
parameterized routes.
How do you use ngFor and ngIf directives?

Answer:
ngFor is a structural directive that repeats a portion of the DOM tree for each
item in a collection. For example: <div *ngFor="let item of items">{{ item
}}</div>.
ngIf is a structural directive that conditionally includes or excludes a portion of
the DOM tree based on a boolean expression. For example: <div
*ngIf="condition">Content to show if condition is true</div>.
What are Angular modules and why are they important?

Answer: Angular modules, defined using the @NgModule decorator, are containers for
a cohesive block of code dedicated to a specific purpose. Modules can contain
components, directives, pipes, and services. The root module (usually AppModule)
bootstraps the application, while feature modules can be used to organize code into
smaller, manageable chunks.
How do you handle forms in Angular?

Answer: Angular provides two main approaches to handling forms: template-driven


forms and reactive forms.
Template-driven forms use directives in the template to manage the form. They are
simple and best suited for simple forms.
Reactive forms provide more control and are more scalable. They are defined
programmatically and allow for dynamic changes and complex validation logic.
What is Angular's HttpClient and how is it used?

Answer: HttpClient is an Angular service that allows you to perform HTTP requests.
It is part of the @angular/common/http package. You use it by importing
HttpClientModule in your module and injecting HttpClient into your services or
components to make HTTP calls, such as GET, POST, PUT, DELETE.
What is Angular's async pipe and how is it used?

Answer: The async pipe is used in templates to handle asynchronous data streams,
such as Observables and Promises. It automatically subscribes to the data stream
and updates the view when new data arrives. For example: <div>{{ data$ |
async }}</div>.
What is two-way data binding in Angular?

Answer: Two-way data binding allows for the synchronization of data between the
model and the view in both directions. It is implemented using the ngModel
directive, and the syntax is [()], known as "banana in a box". For example: <input
[(ngModel)]="property">.
These questions and answers cover fundamental concepts and common practices in
Angular development, making them suitable for developers with 4-5 years of
experience who may need to revisit some basic principles.

more basic

ChatGPT
Absolutely! Here are some more basic Angular interview questions with answers:

Basic Technical Questions


What is Angular CLI, and why is it used?

Answer: Angular CLI (Command Line Interface) is a command-line tool that helps
developers scaffold, build, and maintain Angular applications more efficiently. It
generates the initial project structure, creates components, services, modules, and
handles the build process, making development tasks more streamlined.
What is interpolation in Angular?

Answer: Interpolation is a way to bind data from the component to the view template
in Angular. It uses double curly braces {{ }} syntax to display the component's
data properties in the HTML template. For example: <h1>{{ title }}</h1>.
What is property binding in Angular?

Answer: Property binding is a one-way data binding technique in Angular that allows
you to set an HTML element property to a value from the component's class. It is
denoted by square brackets []. For example: <img [src]="imageUrl">.
What is event binding in Angular?

Answer: Event binding is a one-way data binding technique in Angular that allows
you to listen to events (such as click, change, input, etc.) raised by the HTML
elements and perform actions in response to those events. It is denoted by
parentheses (). For example: <button (click)="handleClick()">Click me</button>.
What is two-way data binding in Angular?

Answer: Two-way data binding is a combination of property binding and event binding
in Angular, allowing automatic synchronization of data between the component class
and the HTML template. It is achieved using the ngModel directive and is commonly
used in form elements like input fields. For example: <input
[(ngModel)]="username">.
What is Angular's ngClass directive used for?

Answer: The ngClass directive in Angular is used to dynamically add or remove CSS
classes to an HTML element based on certain conditions in the component class. It
accepts an object or an array as an input and applies the corresponding CSS
classes. For example: <div [ngClass]="{ 'active': isActive }">.
What is Angular's ngStyle directive used for?

Answer: The ngStyle directive in Angular is used to dynamically set inline styles
to an HTML element based on certain conditions in the component class. It accepts
an object or a CSS style string as an input and applies the corresponding styles.
For example: <div [ngStyle]="{ 'color': isActive ? 'green' : 'red' }">.
What is Angular's ngFor directive used for?

Answer: The ngFor directive in Angular is used to iterate over a collection (such
as an array or object) in the component class and generate HTML elements for each
item in the collection. It is commonly used in conjunction with an array of data to
display a list of items. For example: <li *ngFor="let item of items">{{ item
}}</li>.
What is Angular's ngIf directive used for?

Answer: The ngIf directive in Angular is used to conditionally include or exclude


an element from the DOM based on the truthiness of an expression in the component
class. It is commonly used to show or hide elements based on certain conditions.
For example: <div *ngIf="isLoggedIn">Welcome, {{ username }}</div>.
What is the purpose of Angular's NgModule decorator?

Answer: The NgModule decorator in Angular is used to define a module, which is a


cohesive block of code dedicated to a specific feature or functionality in an
Angular application. It takes a metadata object that specifies the module's
declarations, imports, exports, providers, and bootstrap components.
These questions cover some fundamental concepts in Angular development, focusing on
data binding, directives, and module management, which are essential for developers
with 4-5 years of experience.

3/3

more

ChatGPT
Certainly! Here are some additional basic Angular interview questions along with
their answers:

Basic Technical Questions


What is the purpose of Angular's FormsModule and ReactiveFormsModule?

Answer:
FormsModule: It provides support for template-driven forms in Angular applications.
It exports the FormsModule that contains directives such as ngModel, ngModelGroup,
and ngForm used for data binding and validation in template-driven forms.
ReactiveFormsModule: It provides support for reactive forms in Angular
applications. It exports the ReactiveFormsModule that contains directives such as
FormControl, FormGroup, and FormBuilder used for creating and managing forms
programmatically.
What is dependency injection (DI) in Angular and why is it important?

Answer:
Dependency injection in Angular is a design pattern where components and services
are provided with their dependencies rather than creating them internally. This
allows for better modularity, testability, and reusability of code, as dependencies
can be easily swapped or mocked during testing.
What is an Angular service and how do you create one?

Answer:
An Angular service is a TypeScript class that encapsulates a specific feature,
functionality, or data manipulation logic. It is typically used to share data and
behavior across components. You can create a service by using the @Injectable
decorator and registering it with the Angular dependency injection system.
How do you handle HTTP requests in Angular?

Answer:
Angular provides the HttpClient module to handle HTTP requests. You can inject
HttpClient into your service or component, and then use its methods such as get,
post, put, delete, etc., to make HTTP requests to a server. Angular's HTTP client
module also provides features like interceptors for handling request/response
transformations and error handling.
What is Angular's router outlet used for?

Answer:
router-outlet is a directive provided by Angular's router module that acts as a
placeholder for dynamically loaded components based on the current route. It
dynamically renders the component associated with the current route configuration
inside the host HTML element where the router-outlet directive is placed.
What is Angular's ActivatedRoute used for?

Answer:
ActivatedRoute is a service provided by Angular's router module that contains
information about the route associated with a component loaded in an router-outlet.
It allows you to access route parameters, query parameters, route data, and
navigate to other routes programmatically.
What is Angular's EventEmitter used for?

Answer:
EventEmitter is a class provided by Angular's core module that allows components to
emit custom events that can be listened to by parent components or other parts of
the application. It is commonly used for communication between components,
especially in scenarios where parent-child communication is required.
What is the purpose of Angular's ViewChild and ContentChild decorators?

Answer:
ViewChild: It is used to inject a reference to a child component, directive, or
element into the parent component class. It allows the parent component to access
properties and methods of the child component.
ContentChild: It is similar to ViewChild, but it is used to query projected content
(content passed into a component via ng-content) and inject a reference to it into
the parent component class.
What is Angular's ngOnInit lifecycle hook used for?

Answer:
ngOnInit is a lifecycle hook provided by Angular that is called once after the
component has been initialized and its properties have been bound. It is commonly
used to perform initialization logic such as fetching data from a server,
subscribing to observables, or initializing component state.
What is Angular's ngOnDestroy lifecycle hook used for?

Answer:
ngOnDestroy is a lifecycle hook provided by Angular that is called just before the
component is destroyed and removed from the DOM. It is commonly used to perform
cleanup tasks such as unsubscribing from observables, releasing resources, or
canceling ongoing operations to prevent memory leaks.
These questions cover a range of basic Angular concepts related to forms, services,
HTTP requests, routing, lifecycle hooks, and component interaction, providing a
solid foundation for developers with 4-5 years of experience in Angular
development.

more

ChatGPT
Of course! Here are some more basic Angular interview questions along with their
answers:

Basic Technical Questions


What is Angular's FormsModule and ReactiveFormsModule used for?

Answer:
FormsModule: It provides support for two-way data binding and template-driven forms
in Angular applications. It exports directives like ngModel, ngModelGroup, and
ngForm.
ReactiveFormsModule: It provides support for reactive forms in Angular
applications, allowing you to build dynamic and complex forms programmatically. It
exports directives like FormControl, FormGroup, and FormBuilder.
What is Angular's @Input decorator used for?

Answer:
@Input is a decorator used in Angular to allow a parent component to pass data into
a child component. It marks a property as an input property, and its value can be
set by binding to the property in the parent component's template.
What is Angular's @Output decorator used for?

Answer:
@Output is a decorator used in Angular to allow a child component to emit events to
a parent component. It marks a property as an output property, and its value can be
emitted using the EventEmitter class.
What is Angular's ngOnInit lifecycle hook used for?

Answer:
ngOnInit is a lifecycle hook provided by Angular that is called after Angular has
initialized all data-bound properties of a directive. It is commonly used to
perform initialization logic for a component, such as initializing properties,
fetching data from a server, or subscribing to observables.
What is Angular's ngOnChanges lifecycle hook used for?

Answer:
ngOnChanges is a lifecycle hook provided by Angular that is called when one or more
input properties of a directive change. It receives a SimpleChanges object
containing the previous and current values of the input properties. It is commonly
used to respond to changes in input properties and perform actions accordingly.
What is Angular's ngAfterViewInit lifecycle hook used for?

Answer:
ngAfterViewInit is a lifecycle hook provided by Angular that is called after
Angular has fully initialized a component's view and its child views. It is
commonly used to perform initialization logic that relies on the component's view
being fully initialized, such as querying the DOM or initializing third-party
libraries.
What is Angular's ngOnDestroy lifecycle hook used for?

Answer:
ngOnDestroy is a lifecycle hook provided by Angular that is called when a directive
is being destroyed. It is commonly used to perform cleanup tasks before a directive
is removed from the DOM, such as unsubscribing from observables, releasing
resources, or canceling ongoing operations.
What is Angular's *ngFor directive used for?

Answer:
*ngFor is a structural directive provided by Angular that is used to iterate over a
collection and render a template for each item in the collection. It is commonly
used in conjunction with an array or iterable object to generate a list of elements
in the DOM.
What is Angular's *ngIf directive used for?

Answer:
*ngIf is a structural directive provided by Angular that is used to conditionally
include or exclude an element from the DOM based on an expression. It evaluates the
expression and only renders the element if the expression is truthy.
What is Angular's async pipe used for?

Answer:
The async pipe in Angular is used to automatically subscribe to an asynchronous
data source, such as a Promise or Observable, and then render the result in the
template. It handles subscribing and unsubscribing from the data source
automatically, reducing the risk of memory leaks.
These questions cover additional fundamental concepts in Angular development,
including forms, lifecycle hooks, structural directives, and data binding,
providing a well-rounded understanding for developers with 4-5 years of experience.

more

ChatGPT
Sure, here are some more basic Angular interview questions with answers:

Basic Technical Questions


What is the purpose of Angular's RouterModule?

Answer: Angular's RouterModule is used for setting up routing in an Angular


application. It provides directives like RouterModule.forRoot() and
RouterModule.forChild(), which are used to define the application's routes and
configure navigation between different components.
What is Angular's RouterLink directive used for?

Answer: RouterLink is a directive in Angular used for navigation between different


routes within the application. It allows you to define links in templates that,
when clicked, navigate to the specified route without reloading the entire page.
What is Angular's ActivatedRoute used for?

Answer: ActivatedRoute is a service provided by Angular's router module. It


contains information about the route associated with a component loaded in the
router outlet, including route parameters, query parameters, and route data.
What is Angular's ngSwitch directive used for?

Answer: ngSwitch is a structural directive in Angular used for conditionally


rendering elements based on the value of an expression. It is similar to switch
statements in programming languages and is often used as an alternative to multiple
*ngIf statements.
What is Angular's ngClass directive used for?

Answer: ngClass is a directive in Angular used for dynamically adding or removing


CSS classes to an element based on certain conditions. It accepts an object, array,
or string as input and applies the corresponding CSS classes to the element.
What is Angular's ngStyle directive used for?

Answer: ngStyle is a directive in Angular used for dynamically setting inline


styles to an element based on certain conditions. It accepts an object or a string
as input and applies the corresponding styles to the element.
What is Angular's ngModel directive used for?

Answer: ngModel is a directive in Angular used for two-way data binding between
form controls (like input, textarea, select, etc.) and component properties. It
binds the value of the form control to a property in the component class and
updates the property when the value of the form control changes.
What is Angular's ViewChild decorator used for?

Answer: ViewChild is a decorator in Angular used for accessing child components,


directives, or elements from the parent component class. It allows the parent
component to interact with the child component's properties, methods, or DOM
elements.
What is Angular's ContentChild decorator used for?

Answer: ContentChild is a decorator in Angular used for accessing projected content


(content passed into a component via <ng-content>). It allows the parent component
to query and interact with the projected content from the child component.
What is Angular's NgModule metadata used for?

Answer: NgModule metadata in Angular is used for defining and configuring modules.
It contains properties like declarations, imports, exports, and providers, which
are used to specify the components, directives, pipes, modules, and services that
belong to the module.
These questions cover additional fundamental concepts in Angular development,
including routing, directives, and module metadata, providing a comprehensive
understanding for developers with 4-5 years of experience.

ChatGPT
Certainly! Here are some additional basic Angular interview questions along with
their answers:

Basic Technical Questions


What is Angular's @Injectable decorator used for?
Answer: The @Injectable decorator marks a class as available to be provided and
injected as a dependency. It is used to define services that can be injected into
components or other services using Angular's dependency injection system.
What are Angular pipes and how are they used?

Answer: Pipes in Angular are used to transform data in templates. They take in data
as input and return the transformed data. Commonly used pipes include | date, |
uppercase, | lowercase, | currency, and | json. Custom pipes can also be created
using the @Pipe decorator.
What is a custom pipe in Angular, and how do you create one?

Answer: A custom pipe in Angular is a user-defined transformation function that can


be used in templates. To create a custom pipe, use the @Pipe decorator to define
the pipe's name and implement the PipeTransform interface. For example:
typescript
Copy code
import { Pipe, PipeTransform } from '@angular/core';

@Pipe({name: 'myCustomPipe'})
export class MyCustomPipe implements PipeTransform {
transform(value: string, ...args: any[]): string {
// Transformation logic
return transformedValue;
}
}
What is lazy loading in Angular and why is it important?

Answer: Lazy loading in Angular is a technique for loading modules only when they
are needed, rather than loading all modules at the start of the application. This
helps to improve the initial load time and performance of the application. It is
typically configured in the routing module using the loadChildren property.
What is the difference between ng-content and ng-container?

Answer:
ng-content: Used for content projection, allowing you to insert external content
into a component's template at a specified location.
ng-container: Acts as a logical container that doesn't render any additional DOM
element. It is used to group a set of elements without adding an extra element to
the DOM.
What is Angular's Renderer2 and why would you use it?

Answer: Renderer2 is a service in Angular used for manipulating DOM elements in a


platform-independent way. It provides methods for creating, updating, and removing
DOM elements and attributes, ensuring compatibility across different environments,
such as server-side rendering.
How do you create a custom directive in Angular?

Answer: To create a custom directive in Angular, use the @Directive decorator to


define the directive's metadata and implement any desired logic within the
directive's class. For example:
typescript
Copy code
import { Directive, ElementRef, Renderer2 } from '@angular/core';

@Directive({
selector: '[myCustomDirective]'
})
export class MyCustomDirective {
constructor(private el: ElementRef, private renderer: Renderer2) {
// Directive logic
this.renderer.setStyle(this.el.nativeElement, 'color', 'blue');
}
}
What is Angular's ViewChildren and ContentChildren decorators used for?

Answer:
ViewChildren: Used to query multiple elements or directives from the view of a
component. It returns a QueryList of the matched elements.
ContentChildren: Used to query multiple elements or directives from the content
projected into a component using <ng-content>. It also returns a QueryList of the
matched elements.
What is Angular's HttpInterceptor and how do you use it?

Answer: HttpInterceptor is an interface in Angular that allows you to intercept and


modify HTTP requests and responses globally. To use it, implement the
HttpInterceptor interface and provide the interceptor in the providers array of
your module using the HTTP_INTERCEPTORS injection token. For example:
typescript
Copy code
import { Injectable } from '@angular/core';
import { HttpInterceptor, HttpRequest, HttpHandler, HttpEvent } from
'@angular/common/http';
import { Observable } from 'rxjs';

@Injectable()
export class MyInterceptor implements HttpInterceptor {
intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
const modifiedReq = req.clone({
headers: req.headers.set('Authorization', 'Bearer my-token')
});
return next.handle(modifiedReq);
}
}

// In your module
@NgModule({
providers: [
{ provide: HTTP_INTERCEPTORS, useClass: MyInterceptor, multi: true }
]
})
What is the difference between constructor and ngOnInit in an Angular component?

Answer:
constructor: Used for dependency injection and is called when the component is
instantiated. It should not contain any complex initialization logic.
ngOnInit: A lifecycle hook that is called after Angular has initialized the
component and its data-bound properties. It is used for initialization logic that
requires access to the component's input properties or other lifecycle hooks

You might also like