Especializa / nativescript-ng-shadow

Angular directive to apply shadows to native elements according to the elevation level guidelines of material design specification
Apache License 2.0
54 stars 38 forks source link

Cannot read property 'elevation' of null #23

Open cerealexx opened 5 years ago

cerealexx commented 5 years ago

The documentation says you can pass null or an empty string to the shadow directive to remove the shadow. I'm dynamically passing a number value or null depending on the platform with this method:

public iosShadow(level: string): number {
    if (this.platform === 'ios') {
        return Number(level);
     }
    return null;
}

And view:

<StackLayout [shadow]="iosShadow(2)">
    ...
</StackLayout>

Though I always get this error when passing null: Cannot read property 'elevation' of null