title: Is it bad practice to chain server calls that depend on each other within front end promises?
body: <p>I'm working with the MEAN stack. </p>
  
  <p>For instance, in my angular code I might have: </p>
  
  <pre><code>Brand.create({name: 'name'}).then(function(brand){
  
      //here, the product's referenced brand._id depends on the Brand response
  
      Product.create({'name':'name', 'category': 'food', 
         'brand': brand.data._id}).then(function(res){
           $scope.product = res.data;
     });
  });
  </code></pre>
  
  <p>Would it be better to do this on the server side -- if someone were to refresh or lose connection before the 2nd promise invoked, it seems it could result in only a brand being created -- without an associated product. </p>
  
  <p>If so, would it be a best practice to connect the two different collections within one of their respective controllers?</p>