I encountered an issue:
Error: [ng:areq] Argument 'fn' is not a function, received string
Despite following the recommendations of others, I still have not been able to resolve the problem.
Below is the code snippet in question:
controller.js
angular.module('starter.controllers', [])
.controller('DashCtrl', function ($scope,$ionicScrollDelegate,SocketService) {
var me = this;
me.messages = [];
$scope.sendTextMessage = function() {
var msg = {
'text': me.messages
}
me.messages.push(msg);
$ionicScrollDelegate.scrollBottom();
me.messages = '';
SocketService.emit('mesaj', msg);
};
});
services.js
angular.module('starter.services', [])
.service('SocketService', ['socketFactory'],
function SocketService(socketFactory) {
return socketFactory({
ioSocket: io.connect('http://l92.168.1.27:3000')
});
});