I am new to AngularJS $q and promise, I learn that if I use $http.get(), I can get a promise and I can use its .then function chainly like
how do I know that then has been resolved?
As you noticed, the promise returned by then() is resolved after the callback is executed (which is executed when the first promise is fulfilled). And it does resolve with the result from the callback indeed.
Do I need give a return as resolve?
No, if you don't return anything from the callback, the result is undefined - just like with regular function calls.
However, you do in fact have more options to build a result in your callback than returning a plain value:
return another promise. The promise returned by then() will adopt it, i.e. fulfills with its result or reject with its reason as soon as it settles.throw an exception. It will get automatically caught and the resulting promise is rejected with that error.