Angular: From Zero to Expert

Angular: From Zero to Expert

You Can Now Control What Binds to Your Component Inputs in Angular 22

I've been using withComponentInputBinding() since Angular 16 and honestly, it's one of my favorite router features. No more injecting ActivatedRoute, no more subscribing to params.

Amos Isaila's avatar
Amos Isaila
Apr 06, 2026
∙ Paid
Angular 22: withComponentInputBinding

The short version

provideRouter(routes, withComponentInputBinding({ queryParams: false }))

That’s it. Query params no longer bind to your component inputs. Path params and route data? Still work fine.

Angular: From Zero to Expert is a reader-supported publication. To receive new posts and support my work, consider becoming a free or paid subscriber.

So what was the problem?

Let me show you. Say you have this:

// Route: { path: 'user/:id', component: UserComponent, data: { role: 'admin' } }
// URL: /user/42?tab=settings

@Component({ ... })
export class UserComponent {
  id = input<string>();       // ← from :id
  tab = input<string>();      // ← from ?tab=
  role = input<string>();     // ← from route data
}

All three sources — path params, query params, route data — bind to your inputs automatically. Sounds great until you realize that query params are completely user-controlled. Anyone can type whatever they want in the URL bar.

Picture this:

User's avatar

Continue reading this post for free, courtesy of Amos Isaila.

Or purchase a paid subscription.
© 2026 Amos Isaila · Privacy ∙ Terms ∙ Collection notice
Start your SubstackGet the app
Substack is the home for great culture