@code-workers.io/ng-types
v1.2.0
Published
A utility library for Angular to handle strict types and some coercion helper
Downloads
7
Maintainers
Readme
@code-workers.io/ng-types
Tired of writing e.g. @Input() arg: string | null | undefined
over and over again when using Angular's strict mode?
ng-types
to the rescue! This handy lib provides a collection of types which will reflect strict inputs.
Besides that it offers some coercion helpers to make your life easier.
Installation
npm i @code-workers.io/ng-types
Supported types
StringInput
NumberInput
BooleanInput
DateInput
ArrayInput
ObjectInput
FunctionInput
Nullable<T>
Optional<T>
Coercion helpers
coerceBoolean
coerceNumber
coerceObservable
Compatibility
- Version 1.x.x is compatible with Angular >= 10.0.0