Which is one is better $watch or $timeout

Hi,
when to use $watch and $timeout and which one is better. scenario is like this when i get response from the server , data is not updating UI, So i used timeout with 50ms then its working fine… but someone suggested me that use $watch instead of $timeout . Please let me your suggestions…

If I’m understanding right, it sounds like you would actually use a promise in this case. When getting data from a server, the call is asynchronous, so you can’t expect the data to be there within a specific amount of time. While a $timeout might work in some cases (mostly local testing), once in production they tend to explode.

I’d recommend reading up on promises in AngularJS (here’s a sample tutorial) and see if that’s what you need.