InterviewHubPRO
Section Overview
Q128

Question 128 of 283

Part 6: Decorators, Dependency Injection & Tooling (124 - 150)

45%
Angular & Signals (283 Qs)•Part 6: Decorators, Dependency Injection & Tooling (124 - 150)

What are the restrictions on declarable classes?

Below classes shouldn't be declared,

  1. A class that's already declared in another NgModule
  2. Ngmodule classes
  3. Service classes
  4. Helper classes

Practical Code Example

text
// Restrictions on Declarables:
// 1. Only Components, Directives, and Pipes can be added to declarations
// 2. Each declarable class can be declared in at most ONE NgModule
// 3. Standalone components cannot be added to NgModule declarations