Closed sajankumar closed 9 years ago
Can you tell me how to fix this ?
TypeError: Cannot call method 'connect' of undefined at Object. (http://localhost:8888/SPA_Application/server/js/ngSocket.js:17:23) at Object.d as invoke at https://ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js:35:77 at c (https://ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js:33:83) at Object.d as invoke at https://ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js:35:77 at c (https://ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js:33:83) at d (https://ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js:33:300) at Object.instantiate (https://ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js:33:464) at https://ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js:65:486
You must declare a 'socket.io.js' statements before all scripts of your system.
<script src="/path/to/socket.io.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js"></script>
With requirejs:
//require.config.js shim:{ 'ng-socket': { deps: [ 'angular' './startSocketIo', ] } //startSocketIo.js define([ 'socket.io-client'],function(io) { 'use strict'; window.io = io; });
Can you tell me how to fix this ?
TypeError: Cannot call method 'connect' of undefined at Object. (http://localhost:8888/SPA_Application/server/js/ngSocket.js:17:23)
at Object.d as invoke
at https://ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js:35:77
at c (https://ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js:33:83)
at Object.d as invoke
at https://ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js:35:77
at c (https://ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js:33:83)
at d (https://ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js:33:300)
at Object.instantiate (https://ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js:33:464)
at https://ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js:65:486
You must declare a 'socket.io.js' statements before all scripts of your system.
With requirejs: