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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

can't get appointments to work from api service

Thread ID:





130329 May 7,2017 10:25 AM UTC May 10,2017 11:27 AM UTC AngularJS 2
Tags: ejSchedule
Piotr Kujawski
Asked On May 7, 2017 10:29 AM UTC

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/ at Object._dataProcessing (http://cdn.syncfusion.com/ at Object._bindAppointmentsData (http://cdn.syncfusion.com/ at Object._init (http://cdn.syncfusion.com/ at Object. (http://cdn.syncfusion.com/ at r.fn.init.n.fn.(anonymous function) [as ejSchedule] (http://cdn.syncfusion.com/ at Object.post (http://cdn.syncfusion.com/ 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 07:59 AM UTC

Anyone? Please

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

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. 


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon