I have a JavaScript function
function wantConversation(socket, callback) {
if(socket)
{
socket.emit('user.wantConversation');
}
socket.on('user.getConversation', function(data) {
callback(data);
});
}
it Return a list of Conversations into an array and I call it into my Angular Controller
var panel_app = angular.module('panel-app', [])
.controller('panel-controller', function($scope){
wantConversation(socket, function(data) {
$scope.conversations = data;
});
};
});
But my ng-repeat doesn't work :( i know problem is callback function.
and this is my Html
<div ng-repeat="x in conversations | filter: searchBox">
{{ x.name }}
// ...
</div>