Question · Angular course · Module 10: State Management

Public read-only selectors

Why do we keep state as a private signal in a simple Signals store and expose computed() or asReadonly() to the outside?

Answer options

  • Because computed() is faster than signal()
  • So components can read the state but not modify it directly
  • Because signal() does not work outside a service
  • To avoid importing from @angular/core

You can check the correct answer by solving this task in the CodeWorlds game.