refactor: move away from deprecated apis#3836
Conversation
1ef8835 to
7579ed8
Compare
| TestBed, | ||
| } from '@angular/core/testing'; | ||
| import {NgControl, FormsModule, ReactiveFormsModule, FormControl} from '@angular/forms'; | ||
| import {NgModel, FormsModule, ReactiveFormsModule, FormControl} from '@angular/forms'; |
| _setElementColor(color: string, isAdd: boolean) { | ||
| if (color != null && color != '') { | ||
| this._renderer.setElementClass(this._getHostElement(), `mat-${color}`, isAdd); | ||
| if (isAdd) { |
There was a problem hiding this comment.
I think you can kill this entire function now and just do the null check in _updateColor and call addClass / removeClass directly there.
There was a problem hiding this comment.
This one is used in a couple of other places, as well as inside the button.html so it may be more convenient to keep it. Otherwise we'd need to do this._elementRef.nativeElement all over the place.
| }; | ||
|
|
||
| /** Injection token that can be used to specify the global ripple options. */ | ||
| export const MD_RIPPLE_GLOBAL_OPTIONS = new InjectionToken<RippleGlobalOptions>( |
There was a problem hiding this comment.
Generally prefer line breaking at the higher syntactic level, e.g.:
export const MD_RIPPLE_GLOBAL_OPTIONS =
new InjectionToken<RippleGlobalOptions>('md-ripple-global-options');(at the assignment)
7579ed8 to
87e7f79
Compare
|
Rebased and addressed some of the feedback @jelbourn. |
|
This is a breaking change because Caretaker will need to update Google call sites. |
584aa2a to
51c6d92
Compare
|
Rebased. Should I remove the |
afff9f5 to
dd3329e
Compare
Moves away from the APIs that were deprecated in Angular 4. They include: * Switching from using `OpaqueToken` to `InjectionToken`. * Moving from `Renderer` to `Renderer2`. * Changing the `Injector.get(thing: any)` usages to use the new signature `Injector.get<T>(thing: T)`.
dd3329e to
1c03ac6
Compare
|
It looks like the presubmit failures are because one of the teams in google is injecting the |
|
It may be better to refactor it. We could have a solution that accepts both, but it would add some bloat and at some point we'll have to deprecate it anyway. |
|
@mmalerba if it's not widespread we should just change the team's code |
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Moves away from the APIs that were deprecated in Angular 4. They include:
OpaqueTokentoInjectionToken.RenderertoRenderer2.Injector.get(thing: any)usages to use the new signatureInjector.get<T>(thing: T).