-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Answer: 31 #1153
base: main
Are you sure you want to change the base?
Answer: 31 #1153
Conversation
path: '', | ||
loadComponent: () => | ||
import('./dashboard/dashboard.component').then( | ||
(m) => m.DashboardComponent, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can use the default keyword is you want to avoid the then close. But that's only a proposal, some people prefer it more explicit
@@ -29,5 +32,5 @@ import { Component, Inject } from '@angular/core'; | |||
}, | |||
}) | |||
export class UserShellComponent { | |||
constructor(@Inject(TOKEN) public token: string) {} | |||
token = inject(TOKEN); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One thing I like to do when I create an injectionToken, is to create a custom inject function, like injectToken(). I feel it's nicer.
perfect, you master standalone, routing and nx perfeclty |
Checklist for challenge submission
Warning:
Alternatively, you can still submit your PR to join the list of answered challenges or to be reviewed by a community member. 🔥