angular directives with promises