diff --git a/CommentsFromTom.md b/CommentsFromTom.md new file mode 100644 index 0000000..39e22dc --- /dev/null +++ b/CommentsFromTom.md @@ -0,0 +1,7 @@ +Organization - Overall, I'm a big fan of of the fact that you structured the front-end based on component. Great job :) + +Readability - There's a lot of inconsistency with spaces throughout (4 spaces vs 2 spaces) - you'll be happier in yourcapstones if you all agree to use the same spaces. Seems like a small things, but you'd be surprised how it can get in the way in the long run + +Factories - try implementing a front end data cache in the future - it can help save you http requests and make your app faster! Let me know if you want to see an example of how to do this. + +Security - Your secrets.json is in plain view! Make sure you remove it! diff --git a/browser/js/checkout/checkout.controller.js b/browser/js/checkout/checkout.controller.js index ccacca8..cc095a1 100644 --- a/browser/js/checkout/checkout.controller.js +++ b/browser/js/checkout/checkout.controller.js @@ -9,12 +9,16 @@ app.controller('CheckoutCtrl', function($scope, $uibModal, $state, OrderFactory, }, 0); // add error handling + + /* + TMK: why not put this in a resolve block? + */ AuthService.getLoggedInUser() .then(function(user) { if (user) { $scope.newOrder.user = user; // if user is not logged in there will be no user on the order $scope.newOrder.shippingEmail = user.email; - $scope.newOrder.streetAddress = user.streetAddress; + $scope.newOrder.streetAddress = user.streetAddress; $scope.newOrder.city = user.city; $scope.newOrder.state = user.state; $scope.newOrder.zipCode = user.zipCode;