This repository was archived by the owner on Oct 7, 2020. It is now read-only.
Tags: trimox/angular-mdc-web
Tags
fix: Directives inheriting from components for Ivy template type chec… …ks (#2017) As described in the comments on #1982, Ivy does not appreciate it when directives inherit from components. I found three places where this happens: * `MdcRippleDirective` extends `MdcRippleComponent` * `MdcSelectIcon` extends `MdcIcon` * `MdcTextFieldIcon` extends `MdcIcon` I apologize in advance if any of these attempts are not done correctly (I'm well out of my comfort zone here), as well as for any needless change caused by code formatting. Perhaps a more opinionated `.editorconfig` would help. The last two cases are similar and simpler: as each is apparently designed to augment an `<mdc-icon>` element, I figured that simply eliminating the inheritance could be performed without negative impact. Ripple was more challenging. As the component has effectively no template, I decided to try to implement both with a single directive, as is described in the comments inside the commit. Initially, I tried defining a type alias for `MdcRippleComponent`, in order to be able to fool any existing code (including the tests). This was unsuccessful, as apparently an actual JS object must exist. Therefore, I had to make a couple of small changes to the tests as well, namely replacing instances of `MdcRippleComponent` with `MdcRippleDirective` and changing the way that the test grabs the TS controller object from `componentInstance` to `injector.get()`. The meat of the tests themselves are unmodified, and hopefully that is acceptable. I was able to at least build and run an app using Angular 9.0.0-rc0 out of the box using this branch, and hope that it is at least of some use to others, if only as a stepping stone towards being done more skillfully by somebody more intimately familiar with Angular internals than I. Thank you for this effort, much appreciated @rapropos !!
PreviousNext