Advertisement
Guest User

Untitled

a guest
Aug 24th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. function getConf() { // get from database
  2. return Restangular.all('conf').getList().then(function(conf) {
  3. return conf;
  4. })
  5. }
  6.  
  7. function getConfObject() {
  8. return promiseConf.then(confArr => {
  9. return _(confArr).keyBy('myConf').value();
  10. });
  11. }
  12.  
  13. this.config = null;
  14.  
  15. init () {
  16. ...
  17. this.SomeService.getConfObject().then(conf => {
  18. this.config = do some thing with conf
  19. });
  20. ...
  21. }
  22.  
  23. methodA () {
  24. // Can I be sure that in this place this.config is initialized from databse ?
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement