working sample with ngResource