Skip to content

Conversation

@cexbrayat
Copy link
Member

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • angular.io application / infrastructure changes
  • Other... Please describe:

What is the current behavior?

Currently the migration updates:

constructor(@Inject(LOCALE_ID) locale: string) {
  console.log({ locale });
}

to:

constructor() {
  console.log({ locale });
}

What is the new behavior?

This fixes the migration, and results in:

constructor() {
  const locale = inject(LOCALE_ID);
  console.log({ locale });
}

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Currently the migration updates:

```ts
constructor(@Inject(LOCALE_ID) locale: string) {
  console.log({ locale });
}
```

to:

```ts
constructor() {
  console.log({ locale });
}
```

This fixes the migration, and results in:

```
constructor() {
  const locale = inject(LOCALE_ID);
  console.log({ locale });
}
```
@cexbrayat cexbrayat requested a review from crisbeto July 25, 2024 16:00
@angular-robot angular-robot bot added the area: core Issues related to the framework runtime label Jul 25, 2024
@ngbot ngbot bot added this to the Backlog milestone Jul 25, 2024
@crisbeto crisbeto added action: merge The PR is ready for merge by the caretaker target: minor This PR is targeted for the next minor release labels Jul 25, 2024
@dylhunn
Copy link
Contributor

dylhunn commented Jul 26, 2024

This PR was merged into the repository by commit ca89ef9.

The changes were merged into the following branches: main

@dylhunn dylhunn closed this in ca89ef9 Jul 26, 2024
vladboisa pushed a commit to vladboisa/angular that referenced this pull request Jul 29, 2024
…ar#57134)

Currently the migration updates:

```ts
constructor(@Inject(LOCALE_ID) locale: string) {
  console.log({ locale });
}
```

to:

```ts
constructor() {
  console.log({ locale });
}
```

This fixes the migration, and results in:

```
constructor() {
  const locale = inject(LOCALE_ID);
  console.log({ locale });
}
```

PR Close angular#57134
@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Aug 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker area: core Issues related to the framework runtime target: minor This PR is targeted for the next minor release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants