$promise snippet

type 'ap' and get $promise with success/error functions