ajay.3.sharma
Posts: 0
Joined: Fri Jun 17, 2016 5:45 pm

Unable to apply value from API to screen element

I have created a service to use MYSQL using API Express.
I tired to use this service using BOOTSTRAP and its working fine.
But when I try to use the same in ICONIC app, the API call is successful, but unable to render that value back to the screen object?

Can you help me. Is there something I am missing?
Please find the required screenshots.

Image Image Image Image

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Unable to apply value from API to screen element

Hello -

In your code$scope.get/code function code:

  • on success add -- code$scope.$apply();/code
ajay.3.sharma
Posts: 0
Joined: Fri Jun 17, 2016 5:45 pm

Unable to apply value from API to screen element

Thank you for responding.
Even $scope.$apply(); doesn't help. Still no values on the screen
Is they any way where I am use alert() and see if any value is being fetched from my API response?

I have already tested the API in API express and its working fine.

ajay.3.sharma
Posts: 0
Joined: Fri Jun 17, 2016 5:45 pm

Unable to apply value from API to screen element

Is there something specific with Ionic which I am missing. Its working fine with Bootstrap actually :(

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Unable to apply value from API to screen element

Sure, you can always use the browser developer tools and check the Network tab for an actual response which you getting from your service invocation.

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Unable to apply value from API to screen element

Actually I forgot to mention that you should define Model in your project with such properties for your "user" and actual "id" and after that define your service invocation inside the app and add $scope.$apply();

ajay.3.sharma
Posts: 0
Joined: Fri Jun 17, 2016 5:45 pm

Unable to apply value from API to screen element

Model is defined and it works well in Bootstrap app. My only issue is with Ionic app

ajay.3.sharma
Posts: 0
Joined: Fri Jun 17, 2016 5:45 pm

Unable to apply value from API to screen element

Thanks just saw the browsers developer tools - network tab, the response is sending 5 rows.
I am trying to capture only 1 row result.

How come this issue no come in Bootstrap?

  • More updates +
    The Bootstrap is returning only 1 row, while Ionic call is returning all rows for the same API call.???!!!

    I think its something really basic, which I have not handled?

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Unable to apply value from API to screen element

In this case you haven't passed an id of your requested data. Please check all variables inside your app scope if they are actually getting the corresponding values.

Return to “Issues”