Display sqllite database information in an HTML view using Ionic 2

After executing a select query against the database, I am able to read the results from the logcat and view the data there. However, I am encountering an issue where the data is not rendering in the HTML view after binding.

//data retrieve section
db.executeSql('select * from users', {}).then((data) => {
    this.items = [];
    if(data.rows.length > 0) {
        for(var i = 0; i < data.rows.length; i++) {
            this.items.push({name: data.rows.item(i)});
        }
    }
}

HTML

<ion-item href="#" *ngFor="let x of items" >
    {{x.fname}}
</ion-item>

Answer №1

You've defined the name property within your object, but in your HTML you are attempting to access fname. Therefore, you should update {{x.fname}} to {{x.name}}.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

What methods can be used to access web content with Java programming language?

Reading this foreign language content online has been quite challenging for me. Currently, I am working on an android app that requires reading JSON data from the web. Despite my attempts to figure it out on my own by Google searching, nothing seems to be ...

PHP API encountering a syntax errororEncountering

I'm in the process of developing an Android app and I require a PHP API to establish communication with an SQL Database. Encountering an error while trying to parse JSON at getJarrayFromString(); Upon logging the error, this is what was uncovered: ...

Embedded URL in dynamically created AJAX text

I created a search field that uses ajax/jquery to generate a list of users. Result: <li class="list-group-item"> <span class="glyphicon glyphicon-user"></span> <span class="badge addUserToGroup" data-user="{{ user.getId }}"&g ...

Encrypting href links in Nodemailer with Handlebars for forwarding purposes

I am working on a project that involves utilizing NodeMailer + Handlebars for sending and tracking emails. I am interested in changing every href link to the project URL before redirecting to the destination link. For example: Original email: <a href ...

Unable to track the expansion of table rows using ng-repeat-start(ngAnimate) function

I am trying to update and store the information from an expanded row, specifically the city and work details. However, I am facing an issue where I cannot track the specific row upon clicking... var app = angular.module('app', ['ngAnimate&a ...

Issue with Jquery .scroll() not functioning in Internet Explorer when using both $(window) and $(document). Possible problem with window.pageYOffset?

Here is the code snippet I am currently struggling with: $(window).scroll(function() { var y_scroll_pos = window.pageYOffset; var scroll_pos_test = 200; if(y_scroll_pos > scroll_pos_test) { $('.extratext').slideDown(&a ...

What's preventing canvas from working offline but functioning properly on the TRYIT platform?

I have created some canvas-related code that works perfectly on TRYIT editor, but it fails to work locally when I copied the code into a file and tried to run it. This code is designed to take an image, set the width and height of a canvas based on that i ...

Navigating in Angular is easy when you understand how to use special characters such as

In order to set a unique path in AngularJS routing, I am looking for the following features: An optional parameter The ability to accept values of a relative path Here are some examples of the parameter values I need to work with: /ABC /ABC/123 /ABC/12 ...

What techniques can be used to maintain the value of 'this' when utilizing async.apply?

Employing async.parallel to simultaneously run 2 functions, initiated from a static function within a mongoose model. In this code snippet (where the model contains a static function named verifyParent), I utilize this to access the model and its functions ...

"Mapping without limits: Ionic's Offline Map feature

Currently, I am in the process of creating a hybrid mobile application with Ionic. The app has been fully developed, but now I need to incorporate an offline Google map feature. My goal is to capture the latitude and longitude of the user when there is n ...

Setting the color of an element using CSS based on another element's style

I currently have several html elements embedded within my webpage, such as: <section id="top-bar"> <!-- html content --> </section> <section id="header"> <!-- html content --> </section> <div id="left"> &l ...

Encountering CORS issue despite employing a CORS library

Encountering a CORS error while attempting to deploy my project on render using expressjs and react. The project functions smoothly on localhost, but changing the URLs to match the website results in this error: Access to XMLHttpRequest at 'https:// ...

Using PHP, JavaScript is unable to hide <div> elements

I'm encountering an issue where the div I want to show when an error occurs is not hiding and showing properly using JavaScript. Here is a snippet of my code: <script> function hideerror() { var catdiv = document.getElementById(error); ...

I desire to alter the description of an item within a separate div, specifically in a bootstrap

I used the map method to render all the images. However, I need a way to track the current image index so that I can change the item description located in another div. Alternatively, if you have any other solutions, please let me know. App.js : import Ca ...

Math operations limited by boundaries: adding and subtracting

What is the proper way to implement this logic in JavaScript: Row-=21; if (Row < 1) { Row = 1; } ...

I am puzzled by the Policy Violation notification I received, especially since I have been in compliance with API Level 33 regulations since August 25, 202

Hey there! I'm wondering why Google Play Console has flagged me for violating policy on API Level 33. This issue started on August 25, 2023 with version 7.0.4 currently in production. I made changes to the config XML file. Just so you know, this was ...

Utilizing Node.js and Jasmine: Preventing the invocation of a Promise function to avoid executing the actual code results in DEFAULT_TIMEOUT_INTERVAL

There is a function below that returns a promise. public async getAverageHeadCount(queryParams: Params, childNode: any, careerTrackId: string): Promise<Metric> { const queryId = this.hierarchyServiceApiUrl + "rolling-forecast/ahc/" + q ...

Utilize JavaScript to send an email containing a link and content

In the html form, there are input fields for adding a new user to the database. Once a user is added, an email is sent to them using the sendmail() function in the adduser.js file. The email is sent successfully according to my standards. However, I want t ...

Is there a way to assign a value of 1 to the input-group spinner?

At first, I thought this problem would be easy to solve, but now I'm finding myself stuck. My goal is to have the input-group spinner display the value 1 when a user opens the application. <input id="option1" type="number" min="1" value ="1" ...

How to retrieve values from dynamically generated text boxes using ng-repeat in AngularJS

When using ng-repeat, I am able to display textboxes related to each item. Upon clicking the SaveAll button, I intend to retrieve all textbox values based on ITEM ID and save them to the database. <tr> <td> <table ng-repeat="item in ...