R
R
robotwerter2015-04-03 17:41:31
Angular
robotwerter, 2015-04-03 17:41:31

How to get to the object?

In the console I see the following

Promise {$$state: Object, then: function, catch: function, finally: function}

How to get inside the $$state object?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
R
Ramallah, 2015-04-03
@ramallah

What for you there?

A
Arthur, 2015-04-03
Mudrick @mudrick

Just like inside any other, just through a dot - two dollar signs in the name of the parameter should not confuse you.

var deferred = $q.defer(); // допустим, вы получаете промис из $q (а может быть из $http или $resource, я не знаю)
console.log(deferred.promise); // возвратит объект, и там будет ваш $$state
console.log(deferred.promise.$$state); // возвратит то, что внутри $$state
console.log(deferred.promise.$$state.status); // возвратит status

As commenters have already noted, if you want to do this, then you are doing something wrong, obviously.

A
Andrew, 2015-04-03
@couchemar

it seems to me that what you want to do (and what is it by the way?) needs to be done differently

M
Mikhail Osher, 2015-04-03
@miraage

If there is such a need - 100% you are doing something wrong.
Not even, not 100, but 200%.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question