Data from SQLite Database to <input>?


#1

Hi Ionic Developers,

I just want to ask if anyone managed to feed the data from a SQLite Database to the < Input > textbox? Specifically the “Date” and"Integer" datatypes? I have successfully feed some data. But it only feeds the String datatype. I am not sure why other datatype are not viewing.

Thank you.


#2

Hi,

Normaly just with an ng-value with the correct fetched var it should work.
Can you post your code and make sur by a console log that you receive the correct data from you database ?

Check this module, maybe it would be helpful : https://github.com/abellion/ngDatabase


#3

Hi @abellion,

It was successful when I am using ng-value and with a type = "text. But when I am trying to feed the data on a < input type =“date” >, it won’t appear. What could be the solution for this. BTW, I cannot feed it on a “text” input because I will be getting the data again as forms. It is like a dynamic < input > where the user can update records that were already saved.

Thank you :slight_smile:


#4

BTW @abellion. Thanks for the ngDatabase. :slight_smile: But right now I am using SQLite. Which do you think is more reliable and secured?


#5

Hi Everyone,

This issue isnot yet solved. Anyone got a workaround?

THanks.


#6

As far i know there is no built in input type date in ionic.

I actually keep track of 2 different variables, one feeds the datepicker plugin, the other one is the one i use when i want to store in the sqlite db.

To feed the plugin, you should just go ahead and see what kind of format does the plugin needs. Then write a function that converts a Date variable to do desired format.

I know you might not understand that, feel free to ask :smile:


#7

Did you try for integer input type=“number” or “tel” ?

For date you should take a look in momentjs