return scope.data in promise