We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

can't get appointments to work from api service

Thread ID:

Created:

Updated:

Platform:

Replies:

130329 May 7,2017 06:25 AM May 10,2017 07:27 AM AngularJS 2
loading
Tags: ejSchedule
Piotr Kujawski
Asked On May 7, 2017 06:29 AM

I'm using Angular JS with schedule component. I have a rest api made in asp.net core and I made a client for it in angularjs. I'm trying to get all appointments for the schedule component, however when assigning them to the scope variable that binds to schedule it comes up with an error. I tried googling this error however I haven't found anything useful and I'm not very proficient in angular or javascript yet.When I make an array with appointment objects manually it works, but when I passed it from my appointments service it doesn't. (Also, a bit offtopic but how would I perform CRUD actions for the schedule? Would I use events like "onAppointmentSave" ?)This is the error:angular.js:14525 TypeError: n.sort is not a function at Object._sortAppById (http://cdn.syncfusion.com/15.1.0.41/js/web/ej.web.all.min.js:10:3533264) at Object._dataProcessing (http://cdn.syncfusion.com/15.1.0.41/js/web/ej.web.all.min.js:10:3536745) at Object._bindAppointmentsData (http://cdn.syncfusion.com/15.1.0.41/js/web/ej.web.all.min.js:10:3529006) at Object._init (http://cdn.syncfusion.com/15.1.0.41/js/web/ej.web.all.min.js:10:3298250) at Object. (http://cdn.syncfusion.com/15.1.0.41/js/web/ej.web.all.min.js:10:21539) at r.fn.init.n.fn.(anonymous function) [as ejSchedule] (http://cdn.syncfusion.com/15.1.0.41/js/web/ej.web.all.min.js:10:22796) at Object.post (http://cdn.syncfusion.com/15.1.0.41/js/common/ej.widget.angular.min.js:10:9542) at https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js:17:3 at ra (https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js:85:35) at n (https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js:70:226) ""This is my function to get them from service in controller:appointmentsService.getAppointments().then(function (results) { $scope.appointments = results.data; console.log($scope.appointments); });and then this is my service:(function () { 'use strict'; var app = angular.module("myApp"); app.factory('appointmentsService', ['$http', function($http) { var serviceBase = 'http://localhost:63185/'; var appointmentsServiceFactory = {}; var _getAppointments = function () { return $http.get(serviceBase + 'api/appointments').then(function (results) { return results; }); }; appointmentsServiceFactory.getAppointments = _getAppointments; return appointmentsServiceFactory; }]); }());

Piotr Kujawski
Replied On May 10, 2017 03:59 AM

Anyone? Please

Karthigeyan Krishnamurthi [Syncfusion]
Replied On May 10, 2017 07:27 AM

Hi Piotr,  
 
Thank you for contacting Syncfusion support. 

We have created an incident for your query and we request you to have a follow up with the below incident link for further update on this. 
 
Regards, 
Karthigeyan 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;