Adding compatibility with the AngularJS 1.2

In the last Angular stable release the resource.$then has been removed.
Resource instances do not have a $then function anymore. 
Use the $promise.then instead.

More info:
http://docs.angularjs.org/guide/migration#resource$then-has-been-removed