How can you share a directive among different modules in an Angular application?
- Import the directive in each module
- Share the directive through RxJS
- Use a service
- Use the @SharedDirective decorator
To share a directive among different modules in an Angular application, you can import the directive in each module where you want to use it. This makes the directive available in those modules, ensuring its shared usage.
Loading...
Related Quiz
- What is the primary purpose of two-way data binding in Angular?
- What does a service in Angular typically consist of?
- To navigate to a route conditionally based on the data fetched, you can use a Route Resolver along with the _____ Router Event.
- How can you create a custom validator that depends on multiple form controls?
- What is the primary purpose of End-to-End (E2E) testing in an Angular application?