We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
x
ng g guard auth/test --implements CanLoad
@angular-devkit/architect 0.1000.8 @angular-devkit/build-angular 0.1000.8 @angular-devkit/build-optimizer 0.1000.8 @angular-devkit/build-webpack 0.1000.8 @angular-devkit/core 10.0.8 @angular-devkit/schematics 10.0.8 @angular/cdk 10.2.0 @angular/cli 10.0.8 @angular/material 10.2.0 @ngtools/webpack 10.0.8 @schematics/angular 10.0.8 @schematics/update 0.1000.8 rxjs 6.5.5 typescript 3.9.7 webpack 4.43.0
Anything else relevant?
The generated class:
export class TestGuard implements CanLoad { canLoad( route: Route, segments: UrlSegment[]): Observable<boolean> | Promise<boolean> | boolean { return true; } }
Should be:
export class TestGuard implements CanLoad { canLoad( route: Route, segments: UrlSegment[]): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree { return true; }
}
The return type is not correct, according to angular docs | UrlTree is missing
| UrlTree
The text was updated successfully, but these errors were encountered:
can i work on a PR for it?
Sorry, something went wrong.
@geromegrignon, sure!
fix(@schematics/angular): canLoad guard signature
8e05a5e
add UrlTree to canLoad guard signature to match the documentation and the other implementations Closes: #18751
b17dc80
add UrlTree to canLoad guard signature to match the documentation and the other implementations Closes: #18751 (cherry picked from commit 8e05a5e)
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.
Successfully merging a pull request may close this issue.
🐞 Bug report
Command (mark with an
x
)Is this a regression?
Probably notDescription
generating a guard with canLoad() method creates it with a wrong return type.🔬 Minimal Reproduction
ng g guard auth/test --implements CanLoad
🔥 Exception or Error
🌍 Your Environment
Anything else relevant?
The generated class:
Should be:
}
The return type is not correct, according to angular docs
| UrlTree
is missingThe text was updated successfully, but these errors were encountered: