Then you will send your form data using the fetch api to your server and connect to mysql serverside. Almost like you would send data from a html form. It’s probably easiest to receive it as json or xml in your PHP application.
How can I add the result to an Observable so that I can print that in app using Each tag? I tried looping over the array and add() using data.add(responseObject.user_detail[i]) but it throw OnAdd excpetion.
I assume you want to fetch data from a remote MySQL server? In that case, you need some sort of server-side code to provide an API that the app can connect to (just like with any other app framework).
my API REST is like this: http://api.portal.com/cover-last/
this return a code JSON.
I am using this on your example of Newsfeed just changing values, but this dont get nothing, the changes are this:
function Article(item) {
this.title = item.data.first_title;
this.description = item.data.short_description;
this.author = item.data.edited_slug;
this.published = new Date(item.data.created_at * 1000).toDateString();
this.image = "";
if (item.data.main_image.length > 0) this.image = 'http://www.portal.com/files/article_main/uploads/'+item.data.main_image.upload_prefix+'/'+item.data.main_image.image_name;
};
fetch("http://api.portal.com/cover-last/")
.then(function(response) { data="Hola";})
.then(function(responseObject) {
for (var i in responseObject.thirdFold) {
items.push(new Article(responseObject.thirdFold[i]));
}
data.replaceAll(items);
});
Plase you can help me?
What is the problem on this example?