Recall & Review
beginner
What does it mean for a pipe or directive to be 'standalone' in Angular?
A standalone pipe or directive in Angular can be used independently without needing to be declared inside an NgModule. It simplifies reuse and reduces boilerplate.
Click to reveal answer
beginner
How do you declare a standalone directive in Angular?
You add the property
standalone: true in the directive's decorator, like @Directive({ standalone: true, selector: '[appExample]' }).Click to reveal answer
intermediate
Can standalone pipes and directives be imported into components directly?
Yes, standalone pipes and directives can be imported directly into a component's
imports array, avoiding the need for NgModule imports.Click to reveal answer
intermediate
What is one benefit of using standalone pipes and directives in Angular projects?
They reduce the complexity of module management, making components more self-contained and easier to maintain or share.
Click to reveal answer
advanced
How does Angular 16+ support standalone pipes and directives?
Angular 16+ fully supports standalone pipes and directives, allowing developers to build applications without NgModules by using the new
standalone: true flag.Click to reveal answer
What property must you add to a directive to make it standalone?
✗ Incorrect
The correct property is
standalone: true in the directive decorator.Can standalone pipes be used without importing an NgModule?
✗ Incorrect
Standalone pipes can be imported directly into components without needing an NgModule.
Which Angular version introduced full support for standalone pipes and directives?
✗ Incorrect
Angular 16+ introduced full support for standalone pipes and directives.
What is a key advantage of standalone directives?
✗ Incorrect
Standalone directives reduce the need for NgModules, simplifying code structure.
How do you use a standalone pipe in a component?
✗ Incorrect
Standalone pipes must be imported in the component's imports array to be used.
Explain what standalone pipes and directives are and how they change Angular development.
Think about how Angular used to require NgModules for these.
You got /4 concepts.
Describe the steps to create and use a standalone directive in an Angular component.
Focus on declaration, import, and usage.
You got /3 concepts.