-
-
Notifications
You must be signed in to change notification settings - Fork 279
Refactor: Update to New Control Flow, Remove standalone: true, and Make DI Readonly #1603
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
Conversation
✅ Deploy Preview for analog-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for analog-ng-app ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for analog-app ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
… in v19), and make DI readonly
✅ Deploy Preview for analog-blog ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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.
Hey, thanks for the changes! I left a few comments around Prettier and a missed standalone flag.
Could you also look at other migrations to automate this? It seems that you've made these changes manually.
ngOnInit(): void { | ||
this.shippingCosts = this.cartService.getShippingPrices(); | ||
} | ||
shippingCosts: Observable<{ type: string; price: number }[]> = |
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.
minor: Type can be inferred now since we are directly assigning it. This was needed previously because the assignment happened separately from declaration.
shippingCosts: Observable<{ type: string; price: number }[]> = | |
shippingCosts = |
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.
I've removed my comments regarding prettier and made those changes in #1604 - No impact on your PR here!
import { AsyncPipe, CurrencyPipe, NgForOf } from '@angular/common'; | ||
import { Component, inject, OnInit } from '@angular/core'; | ||
import { AsyncPipe, CurrencyPipe } from '@angular/common'; | ||
import { Component, inject } from '@angular/core'; | ||
|
||
import { Observable } from 'rxjs'; | ||
import { CartService } from '../../cart.service'; | ||
|
||
@Component({ | ||
selector: 'app-shipping', | ||
standalone: true, |
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.
minor: This one was missed.
standalone: true, |
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.
LGTM, thanks!
template: ` | ||
<p *ngIf="product && product.price > 700"> | ||
<p> | ||
@if ( product() && product()!.price > 700 ) { |
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.
The @if
should be outside the whole block
@if ( product() && product()!.price > 700 ) { | |
@if ( product() && product()!.price > 700 ) { |
… separate files and moved the condition block.
PR Checklist
This PR updates the project to align with Angular v19 improvements:
Updated to new control flow to leverage the latest Angular features.
Removed standalone: true as it is now the default behavior in Angular v19.
Made dependency injection (DI) readonly for better immutability and code safety.
Does this PR introduce a breaking change?