Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CommentsFromTom.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Organization - in general, I really like the way this is organized by component. In a larger project, you would want to be sure to separate each Angular constructor (factories, controllers, config, etc) into different files so that you don't have people working on the same files so much. Like we discussed, there would be lots of opportunities to modularize the HTML markup into directives, as well :)

Security - Your secrets.json is in plain view! Make sure you remove it!
3 changes: 2 additions & 1 deletion browser/js/found-product/foundproduct.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ app.config(function ($stateProvider) {
app.controller('FoundProductController', function ($state,$mdSidenav,$scope,productInfo,CartFactory, AuthService, StoreFactory) {
$scope.product = productInfo;
$scope.quantity = 1;
/* TMK: Why not resolve this? */
AuthService.getLoggedInUser(false).then(function(user){
if(!user) return;
$scope.isAdmin = user.isAdmin;
Expand All @@ -33,7 +34,7 @@ app.controller('FoundProductController', function ($state,$mdSidenav,$scope,prod
StoreFactory.getStoreById(productInfo.store)
.then(function(storeUrl){
$state.go("store",{url:storeUrl.data});
});
});
}

});
Expand Down
8 changes: 7 additions & 1 deletion browser/js/store/store-edit.factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ app.factory('StoreEditFactory', function($http){

var factory = {};

/*
TMK: Right idea, but by having this on the factory as a property, anyone can access
it and mutate it however they want! Instead, store it in a variable - that
way, your methods have closure over it, but the outside world can only access it
through the API you expose
*/
factory.store = {};

factory.returnStore = function(){
Expand Down Expand Up @@ -81,4 +87,4 @@ app.factory('StoreEditFactory', function($http){

return factory;

});
});
3 changes: 2 additions & 1 deletion browser/js/user-profile/user-profile.state.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ app.config(function($stateProvider){

$scope.user = user;
$scope.orders = user.orders;
/* TMK: This seems like something you could store in app.constant. You use it in multiple places! */
$scope.states = "Alabama,Alaska,Arizona,Arkansas,California,Colorado,Connecticut,Delaware,Florida,Georgia,Hawaii,Idaho,Illinois,Indiana,Iowa,Kansas,Kentucky,Louisiana,Maine,Maryland,Massachusetts,Michigan,Minnesota,Mississippi,Missouri,Montana,Nebraska,Nevada,New Hampshire,New Jersey,New Mexico,New York,North Carolina,North Dakota,Ohio,Oklahoma,Oregon,Pennsylvania,Rhode Island,South Carolina,South Dakota,Tennessee,Texas,Utah,Vermont,Virginia,Washington,West Virginia,Wisconsin,Wyoming".split(",");
$scope.saved = false;

Expand Down Expand Up @@ -53,4 +54,4 @@ app.config(function($stateProvider){
}
});

});
});