Work on the following approach:
$q.when()
.then(checkCookieToken) // check if cookie already exists e.g. in cookie
.then(setHeader) // set Header with REST-Token e.g from cookie
.then(checkTokenOnline) // if not OK logout
.then(getMenu) // if previous OK get navigation menu
.then(getDataResource) // set ngResource
.then(getData); // and query it
4 Questions:
1) If, for example, it’s checkTokenOnlinenot in order, I don’t want to perform other functions, how can I exit (exit, break, whatever, ..) at this moment?
2) How to install some of them in parallel, and some of them are serial?
3) How can I transfer data between them?
4) How can I make the following dependency dependency on her previous result?
user2227400
source
share