angular-cn/tools/public_api_guard/platform-browser
Paul Gschwendtner 10a1e1974b fix(platform-browser): debug element query predicates not compatible with strictFunctionTypes (#30993)
Currently developers can use the `By` class to construct common
`DebugElement` query predicates. e.g. `By.directive(MyDirective)`.

The `directive()` and `all()` predicates are currently returning
a predicate that works for `DebugElement` nodes. This return type
is too strict since the predicate is not specific to `DebugElement`
instances and can also apply to `DebugNode` instances.

Meaning that developers are currently able to use the `directive()`
predicate when using `queryAllNodes()`. This is a common practice
but will break when the project is compiled with TypeScript's
`--strictFunctionTypes` flag as the `DebugElement` predicate type
is not assignable to predicates for `DebugNode`. In order to make
these predicates usable with `--strictFuntionTypes` enabled, we
adjust the predicate type to reflect what is actually needed for
evaluation of the predicate.

PR Close #30993
2019-07-18 14:21:26 -07:00
..
animations.d.ts docs: update platform-browser with `@publicApi` tags (#26595) 2018-10-19 14:35:52 -07:00
platform-browser.d.ts fix(platform-browser): debug element query predicates not compatible with strictFunctionTypes (#30993) 2019-07-18 14:21:26 -07:00
testing.d.ts docs: remove all deprecated `@stable` jsdoc tags (#23210) 2018-04-10 21:49:32 -07:00