Angular - ModulesHow can you share a directive declared in one Angular module with multiple other modules without redeclaring it?AAdd the directive to the providers array of each module.BDeclare the directive in each module that needs it.CDeclare the directive in one module and export it; import that module in others.DUse the directive without declaring or importing it.Check Answer
Step-by-Step SolutionSolution:Step 1: Understand Angular's module sharingTo share a directive, declare and export it in one module.Step 2: Import the module in other modulesOther modules import the module that exports the directive to use it without redeclaring.Final Answer:Declare the directive in one module and export it; import that module in others. -> Option CQuick Check:Export once, import many [OK]Quick Trick: Export directive once; import module everywhere [OK]Common Mistakes:Redeclaring directive in multiple modulesAdding directives to providersUsing directives without declaration or import
Master "Modules" in Angular9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallPerf
More Angular Quizzes Angular Fundamentals - How Angular differs from React and Vue - Quiz 9hard Angular Modules - Why modules organize applications - Quiz 15hard Component Interaction - @ViewChild decorator usage - Quiz 8hard Component Interaction - ng-content for slot-based composition - Quiz 12easy Component Interaction - @Input decorator for parent to child - Quiz 1easy Lifecycle Hooks - Lifecycle execution order mental model - Quiz 15hard Pipes - Pure vs impure pipes - Quiz 8hard Templates and Data Binding - Property binding with square brackets - Quiz 14medium TypeScript in Angular - Decorators as TypeScript feature - Quiz 3easy TypeScript in Angular - Generics in Angular services - Quiz 4medium