nativescript-ng-shadow
nativescript-ng-shadow copied to clipboard
ERROR TypeError: Cannot read property 'unit' of null
Hi,
I'm not able to use shadow when inside of a RadListView and ng-template. Always throw that error..
Any workaround?
Thanks
+1
this is how my listview item looks
<ng-template tkTemplateKey="error" let-item="item.payload">
<Stacklayout class="light-background" margin="15, 15, 20, 15" shadow="7">
<Label class="slight-dark-color" margin="10" [text]="item.errorText"></Label>
</Stacklayout>
</ng-template>
ERROR TypeError: Cannot read property 'payload' of undefined
JS: ERROR CONTEXT {
JS: "view": {
JS: "def": {
JS: "nodeFlags": 50970627,
JS: "rootNodeFlags": 3,
JS: "nodeMatchedQueries": 0,
JS: "flags": 0,
JS: "nodes": [
JS: {
JS: "nodeIndex": 0,
JS: "parent": null,
JS: "renderParent": null,
JS: "bindingIndex": 0,
JS: "outputIndex": 0,
JS: "checkIndex": -1,
JS: "flags": 2,
JS: "childFlags": 0,
JS: "directChildFlags": 0,
JS: "childMatchedQueries": 0,
JS: "matchedQueries": {},
JS: "matchedQueryIds": 0,
JS: "references": {},
JS: "ngContentIndex": null,
JS: "childCount": 0,
JS: "bindings": [],
JS: "bindingFlags": 8,
JS: "outputs": [],
JS: "element": null,
JS: "provider": null,
JS: "text": {
JS: "prefix": "\n "
JS: },
JS: "query": null,
JS: "ngContent": null
JS: },
JS: {
JS: "nodeIndex": 1,
JS: "parent": null,
JS: "renderParent": null,
JS: "bindingIndex": 0,
JS: "outputI...
Hi @TheOriginalJosh - Sorry to bother you but I wonder if you will have any idea how can we fix it?
@devlfm -
I was able to workaround this issue with creating shadow to the element dynamically on itemLoading
event.
Like this: HTML:
<RadListView class="full-stretch" [items]="items" (itemLoading)="onItemLoading($event)">
</RadListView>
TS:
public onItemLoading(args: ListViewEventData) {
Shadow.apply(args.view, { elevation: 7 });
}
@shabib3 How did you get access to Shadow ? What import did you use?
Figured that out, yet it doesn't work for me either. There is still no shadow in the ListItem - even when removing all styling as I had a background set before.
I have the same issue with nativescript-fresco
. I think this relates to RadlistView
component. Any workaround?