Two-way binding in AngularJS refers to the data model ($ scope) and your view (directives). For example, if the data changes in your model, the view will automatically update. Similarly, if the user changes the data in the view, your model will automatically update.
Interaction with web services is carried out through the service module $ http. Thus, to get data from your RESTful API, you would do something like:
$http.get('/someUrl').success(successCallback);
Full documentation for $ http is on the AngularJS website . I think you will find that it is very similar to jQuery $ .ajax methods. You easily configure $ http.get () for a short poll using the wail> w500> $ service (basically a wrapper for setTimeout).
For real-time updates between the AngularJS client and the server API, you can see Socket.io . It uses node.js to create a direct socket connection between the browser and the server and has flash (long, polling) mechanisms for older browsers. GitHub has a template project that demonstrates how to configure AngularJS using Socket.io: https://github.com/btford/angular-socket-io-seed
In reply:
Is there a two-way data binding function angular ($ resource or $ http) that automatically retrieves data from the server every n seconds?
No, two-way binding between models and angular views.
Does he naturally use a lengthy survey, a short survey, or websites?
Angular does not include any of them by default. You must configure them yourself.
Do you need jQuery to achieve server-client synchronization, or can everything be done using Angular?
$ http, in a broad sense, is the equivalent of angular jQuery $ .ajax
Do you need to add extra code for this to happen? Do I need to use $ timeout?
Use $ timeout for a short survey or minimize your own solution for long surveys and / or websites (see the angular-socket-io-seed project).