Advertisement
Guest User

Untitled

a guest
Mar 18th, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Promise.all(
  2.     $scope.temps.filter((v) => !!v.model && v.model.type === 'dir').map(() => {
  3.         return $scope.apiMiddleware.getFiles(v.model.realPath + (v.model.realPath.length > 0 ? '/' : '') + v.model.name).then(function(response) {
  4.             if (!!response.result) {
  5.                 return response.result.filter((fv) => fv.type === 'file')
  6.             } else {
  7.                return []; // pysyy tulokset samana tyyppinä
  8.             }
  9.           });
  10.     })
  11. ).then(() => {
  12.    
  13. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement