Goal
I was creating a dishdetailpage of each dish on the menu page of my app , which is opend on clicking the image of each dish .
What I was getting?
When on clicking the image of a dish on menu page , it is opening the dishdetail page with the error as follows --
Error: Uncaught (in promise): TypeError: Cannot read property 'rating' of null
TypeError: Cannot read property 'rating' of null
at http://localhost:8100/build/main.js:128:81
at Array.forEach (<anonymous>)
at new DishdetailPage (http://localhost:8100/build/main.js:128:28)
at createClass (http://localhost:8100/build/vendor.js:12859:20)
at createDirectiveInstance (http://localhost:8100/build/vendor.js:12700:37)
at createViewNodes (http://localhost:8100/build/vendor.js:14158:53)
at createRootView (http://localhost:8100/build/vendor.js:14047:5)
at callWithDebugContext (http://localhost:8100/build/vendor.js:15472:42)
at Object.debugCreateRootView [as createRootView] (http://localhost:8100/build/vendor.js:14755:12)
at ComponentFactory_.create (http://localhost:8100/build/vendor.js:11652:46)
at c (http://localhost:8100/build/polyfills.js:3:19752)
at Object.reject (http://localhost:8100/build/polyfills.js:3:19174)
at NavControllerBase._fireError (http://localhost:8100/build/vendor.js:54636:16)
at NavControllerBase._failed (http://localhost:8100/build/vendor.js:54629:14)
at http://localhost:8100/build/vendor.js:54676:59
at t.invoke (http://localhost:8100/build/polyfills.js:3:14976)
at Object.onInvoke (http://localhost:8100/build/vendor.js:5134:33)
at t.invoke (http://localhost:8100/build/polyfills.js:3:14916)
at r.run (http://localhost:8100/build/polyfills.js:3:10143)
at http://localhost:8100/build/polyfills.js:3:20242
Why am I getting this error and how to fix this?
Attachment:
error_904cf8fd.zip