Eliya Cohen Eliya Cohen - 3 months ago 21x
AngularJS Question

Angular 2 export property which is string or null

Let's say I have a property that can be a String or NULL. So I thought about doing this in Angular 2:

export class Slide {
link: string|null;

and then I get an error which says

Type expected.

So, how can I tell Angular that my
property can be either String or NULL?


link: string; is sufficient.

You can always store null in a property, whatever its type is.