angular-cn/packages/common/test
cexbrayat 95830ee584 feat(common): stricter types for SlicePipe (#30156)
Adds overloads to the `transform` methods of `SlicePipe`,
to have better types than `any` for `value` and `any` as a return.
With this commit, using `slice` in an `ngFor` still allow to type-check the content of the `ngFor`
with `fullTemplateTypeCheck` enabled in Ivy:

    <div *ngFor="let user of users | slice:0:2">{{ user.typo }}</div>
                                                        |
                                                        `typo` does not exist on type `UserModel`

whereas it is currently not catched (as the return of `slice` is `any`) neither in VE nor in Ivy.

BREAKING CHANGE
`SlicePipe` now only accepts an array of values, a string, null or undefined.
This was already the case in practice, and it still throws at runtime if another type is given.
But it is now a compilation error to try to call it with an unsupported type.

PR Close #30156
2019-05-17 14:21:36 -07:00
..
directives fix(ivy): ViewContainerRef.destroy should properly clean the DOM (#29414) 2019-03-22 13:13:12 -07:00
i18n Revert "feat(ivy): use i18n locale data to determine the plural form of ICU expressions (#29249)" (#29918) 2019-04-15 16:55:51 -07:00
location feat(common): provide replacement for AngularJS $location service (#30055) 2019-04-24 13:49:29 -07:00
pipes feat(common): stricter types for SlicePipe (#30156) 2019-05-17 14:21:36 -07:00
BUILD.bazel feat(common): add ability to retrieve the state from Location service (#30055) 2019-04-24 13:49:28 -07:00
common_module_spec.ts test(ivy): run common tests with ivy on ci (#27071) 2018-11-13 10:59:55 -08:00
cookie_spec.ts build: remove `main()` from specs (#21053) 2017-12-22 13:10:51 -08:00
spies.ts build: fix file paths after moving modules/@angular/* to packages/* 2017-03-08 16:29:28 -08:00
viewport_scroller_spec.ts fix(common): escape query selector used when anchor scrolling (#29577) 2019-03-29 10:39:38 -07:00