Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,152,114 members, 7,814,913 topics. Date: Wednesday, 01 May 2024 at 11:07 PM

Hybrid Application Using Ionic And Angulas Js Problem. - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Hybrid Application Using Ionic And Angulas Js Problem. (980 Views)

Help With This Js Problem / Advanced Pdfs On React, Ionic And Kotlin / I Need A Native Mobile App Developer With Experience In Ionic And Angular JS (2) (3) (4)

(1) (Reply) (Go Down)

Hybrid Application Using Ionic And Angulas Js Problem. by bartekziom5: 12:27pm On Feb 08, 2017
Hi
I'm trying to add points to my Ionic app database. To do that I'm getting existing points from database and add them to the points that I will input. After I want to update those summed points to my database.With my code the browser is giving me error: "server responded with status 500 critical exception" if you have any idea how please help me solve this problem.

(The $scope.points and $scope.input datatype is float) This is my code:

.controller('AppCtrl', function($scope, PointService) {
$scope.points = [];
$scope.input = {};



function getAll() {
PointService.getPoints()
.then(function (result) {
$scope.points = result.data.data;
});
}


$scope.updatePoints = function() {

$scope.sum = parseFloat($scope.points) + parseFloat($scope.input);

PointService.addPoints($scope.sum)
.then(function(result) {
$scope.input = {};
getAll();
});
}
Re: Hybrid Application Using Ionic And Angulas Js Problem. by Nobody: 1:12pm On Feb 08, 2017
HTTP 500 could be any error, however it means it's an issue with your server, are you in control of the backend. if so whatever platform you are on you should be able to read logs of error, I am just hoping the backend is not in WordPress API if so, you're in for a long hellish ride.
Re: Hybrid Application Using Ionic And Angulas Js Problem. by trytillmake(m): 1:56pm On Feb 08, 2017
this should be angular 1.0 right?
Re: Hybrid Application Using Ionic And Angulas Js Problem. by bartekziom5: 2:18pm On Feb 08, 2017
pcguru1:
HTTP 500 could be any error, however it means it's an issue with your server, are you in control of the backend. if so whatever platform you are on you should be able to read logs of error, I am just hoping the backend is not in WordPress API if so, you're in for a long hellish ride.

An error occurred, please try again or contact the administrator. Error details: Cannot convert type 'double' to 'System.Collection this is what logs tells me. Im using backand as backend.
Re: Hybrid Application Using Ionic And Angulas Js Problem. by bartekziom5: 2:18pm On Feb 08, 2017
trytillmake:
this should be angular 1.0 right?

yes
Re: Hybrid Application Using Ionic And Angulas Js Problem. by Nobody: 2:22pm On Feb 08, 2017
bartekziom5:


An error occurred, please try again or contact the administrator. Error details: Cannot convert type 'double' to 'System.Collection this is what logs tells me. Im using backand .NET as backend.

I will be honest upfront, my C# skills is old i haven't touched it since 2012

However I would need more information what Class are you using from the collection namespace, and is it expecting a Array of numbers because am assuming .NET will Map the Array to whatever Collection type you are using.

Are you the one who wrote the API in .NET ?
Re: Hybrid Application Using Ionic And Angulas Js Problem. by trytillmake(m): 3:57pm On Feb 08, 2017
bartekziom5:


An error occurred, please try again or contact the administrator. Error details: Cannot convert type 'double' to 'System.Collection this is what logs tells me. Im using backand as backend.

Ok Oga from the error " Cannot convert type 'double' to 'System.Collection" the compiler is saying wat u given it is a double variable while what it is given u is a collection object possibly a list of items u intend looping over. So declare a List<T> object of that same class [not a double], pass the collection to it then loop through the object u just created using " foreach (var item in object) {} "

..... hope i fit help.

(1) (Reply)

Need A Programmer Intrested In Creating A Startup / I Need A PHP Web Developer / Bitcoin Mining $ 1 Every Day

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 12
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.