davidjcoombs
Posts: 0
Joined: Wed Jun 24, 2020 2:57 am

Error when trying to run master-detail pages

When I build a master-detail page (per instructions in the youtube lesson at https://www.youtube.com/watch?v=Kehn1... and in docs at https://docs.appery.io/docs/appbuilde...), an error is returned when I run a test. The error is due to this snippet of code, which is the listener saving the selected item to local storage.

element.on("click", function () {
Apperyio.storage.selectedProduct.set(value);
});

I haven't been able to find any guidance on master-detail pages with listeners that have worked for me, including appery.io docs, youtube videos, etc.

The error message is:

ERROR in src/app/main/main.ts:65:29 - error TS2552: Cannot find name 'element'. Did you mean 'Element'?

65 element.on("click", function() {

Code: Select all


 ../../../../noderepo/ionic4/node_modules/typescript/lib/lib.dom.d.ts:4998:13 
 4998 declare var Element: { 
 ~~~~~~~ 
 'Element' is declared here. 
 src/app/main/main.ts:66:33 - error TS2304: Cannot find name 'Apperyio'. 

 66 Apperyio.storage.selectedProduct.set(value); 
 ~~~~~~~~
Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Error when trying to run master-detail pages

Hello David,

You use the Ionic 4 platform, but the tutorial is about the JQM. If you just test the platform we suggest you to create a brand new app, based on JQM. If you already have the application ready-please let us know that, we will show you the example for Ionic 4

davidjcoombs
Posts: 0
Joined: Wed Jun 24, 2020 2:57 am

Error when trying to run master-detail pages

Hi Serhii,

Thanks for letting me know. Yes, I have already built the app in Ionic 4 and that’s the platform I would prefer to use for future development. If you could provide the example of master-detail for that platform, that would be very helpful.

David

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Error when trying to run master-detail pages

Please see this tutorial on how to use it: https://docs.appery.io/docs/ionic-4-n...

Also, you can read the clicked item in the click event with a custom code:prealert(JSON.stringify(currentItem.itemData));/pre
You can save it in the Storage variable (you can see the example code in the list of snippets)
Image

Return to “Issues”