In this tutorial. we will create an application to display the prices of products in my store
And this is the database!
Let's create a new project!
1st. We create the IMA Project
Then. we create an ionic project!
You can use shortcut commands. or execute commands as usual
Let's make a page! the page name is price
Now. this page! We will link it to the menu
Next. order the ima-project to match the ionic project!
We will update the Ionic Native and Cordova Plugins
You can run shortcut commands. or execute commands as usual.
Now! we will run an ionic emulator. I will use a real device for testing
We will create a table along with its columns
In the case of using an existing database. what must be considered is:
The names of the columns created must be the same as those in the MySQL Database.
And so for the table name. it must be written the same as the one in the mysql database
After setting up backend configuration. we will create a Restful API
This can use PHP Native Generator
fill in the Database Name. Host Name. User Name
and Password column in accordance with existing ones
And the others I leave the default
Then we save it!
And the codes will be made! however. all we need is a restful-API code
The code will be used as a rest-api.php file
OK. let's take a test!
If you have worked properly.
we repeat again so that it is in accordance with what is needed
Next. we will use JSON scraping addons
Select the target page. then fill in the page title
and fill in "JSON URL for List Item". then click the save change button
Then press the "get all variables" button to enable auto complete
Then fill in all variables according to those in JSON
After everything is finished
We save and see the results in the emulator
Go to the "Directives" menu
and in the "Additional Directives" box. click the "Generate Code" button as needed
Next. we must update Ionic Native and Cordova Plugins
Then run the emulator again!
And we will add a barcode scanner to JSON scraping and menus
Let's test!
And also the Barcode option will appear on the Menu
Let's test!