Skip to content
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

Angular no longer exports RadioControlRegistry (ɵangular_packages_forms_forms_r) #782

Closed
TrevorKarjanis opened this issue Oct 14, 2022 · 0 comments · Fixed by #790
Closed
Assignees
Labels
bug Something isn't working

Comments

@TrevorKarjanis
Copy link
Contributor

TrevorKarjanis commented Oct 14, 2022

🐛 Bug Report

The NimbleRadioControlValueAccessorDirective extends RadioControlValueAccessor which depends on RadioControlRegistry which is no longer exported from @angular/forms in Angular 13 and 14.

💻 Repro or Code Sample

Upgrade to Angular 13, and run npm run build.

🤔 Expected Behavior

As outlined in #732, public API should not be extended unless explicitly documented as supported. In addition, RadioControlRegistry is private.

😯 Current Behavior

✖ Compiling with Angular sources in Ivy partial compilation mode.
projects/ni/nimble-angular/src/directives/radio/nimble-radio-control-value-accessor.directive.ts:3:56 - error TS2305: Module '"@angular/forms"' has no exported member 'ɵangular_packages_forms_forms_r'.

3 import { NG_VALUE_ACCESSOR, RadioControlValueAccessor, ɵangular_packages_forms_forms_r } from '@angular/forms';
                                                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
projects/ni/nimble-angular/src/directives/radio/nimble-radio-control-value-accessor.directive.ts:28:86 - error NG2003: No suitable injection token for parameter '_registry' of class 'NimbleRadioControlValueAccessorDirective'.
  Consider using the @Inject decorator to specify an injection token.

28     public constructor(renderer: Renderer2, private readonly elementRef: ElementRef, _registry: ɵangular_packages_forms_forms_r, _injector: Injector) {

💁 Possible Solution

🔦 Context

I am trying to upgrade Nimble to Angular 13 and 14.

🌍 Your Environment

  • OS & Device: Windows
  • nimble-angular Version: latest
@TrevorKarjanis TrevorKarjanis added bug Something isn't working triage New issue that needs to be reviewed labels Oct 14, 2022
@m-akinc m-akinc removed the triage New issue that needs to be reviewed label Oct 18, 2022
@m-akinc m-akinc self-assigned this Oct 18, 2022
rajsite added a commit that referenced this issue Oct 25, 2022
)

# Pull Request

## 🤨 Rationale

Fixes #782 

## 👩‍💻 Implementation

Copied several types from the Angular source base into the Nimble repo,
including:
- RadioControlValueAccessor
- RadioControlRegistry
- BaseControlValueAccessor

We're pulling in version 14.2.6 since we will soon be upgrading Nimble's
version of Angular. To make it work with version 12 in the meantime, I
made one small change to an error reporting function to throw an Error
rather than a RuntimeError. Throwing an Error is what it did in version
12.

## 🧪 Testing

Unit tests still pass

## ✅ Checklist

- [x] I have updated the project documentation to reflect my changes or
determined no changes are needed.

Co-authored-by: Milan Raj <rajsite@users.noreply.github.com>
Co-authored-by: Jonathan Meyer <jonathan.meyer@ni.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Development

Successfully merging a pull request may close this issue.

2 participants