+
Skip to content

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

Merged
merged 4 commits into from
Feb 7, 2025

Conversation

JeevanMahesha
Copy link
Contributor

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?

  • Yes
  • No

Copy link

netlify bot commented Feb 7, 2025

Deploy Preview for analog-docs ready!

Name Link
🔨 Latest commit fd386e9
🔍 Latest deploy log https://app.netlify.com/sites/analog-docs/deploys/67a62a31b8671b0007dfea40
😎 Deploy Preview https://deploy-preview-1603--analog-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Feb 7, 2025

Deploy Preview for analog-ng-app ready!

Name Link
🔨 Latest commit fd386e9
🔍 Latest deploy log https://app.netlify.com/sites/analog-ng-app/deploys/67a62a3149e7f80008574242
😎 Deploy Preview https://deploy-preview-1603--analog-ng-app.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Feb 7, 2025

Deploy Preview for analog-app ready!

Name Link
🔨 Latest commit fd386e9
🔍 Latest deploy log https://app.netlify.com/sites/analog-app/deploys/67a62a3190375f00088dc681
😎 Deploy Preview https://deploy-preview-1603--analog-app.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Feb 7, 2025

Deploy Preview for analog-blog ready!

Name Link
🔨 Latest commit fd386e9
🔍 Latest deploy log https://app.netlify.com/sites/analog-blog/deploys/67a62a315d7ed8000895a589
😎 Deploy Preview https://deploy-preview-1603--analog-blog.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Contributor

@ajitzero ajitzero left a 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 }[]> =
Copy link
Contributor

@ajitzero ajitzero Feb 7, 2025

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.

Suggested change
shippingCosts: Observable<{ type: string; price: number }[]> =
shippingCosts =

Copy link
Contributor

@ajitzero ajitzero Feb 7, 2025

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,
Copy link
Contributor

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.

Suggested change
standalone: true,

Copy link
Contributor

@ajitzero ajitzero left a 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 ) {
Copy link
Member

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

Suggested change
@if ( product() && product()!.price > 700 ) {
@if ( product() && product()!.price > 700 ) {

… separate files and moved the condition block.
@brandonroberts brandonroberts merged commit 44b29cf into analogjs:beta Feb 7, 2025
22 of 24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载