# Tag Info

Accepted

### AngularJS - REST + Authentication service

Avoiding the fact this code appears to be off-topic (because you mention it's incomplete), I still think it would prompt an interesting review. I'm so pretty Let's first address some superficial ...
• 3,753

### Cardshifter game lobby

Well, there's lots of code needing review. I've done my best to split it into each language. I've avoided reviewing Angular, since it's a library I'm not comfortable with. HTML: You have tons and ...
• 5,613

### Cardshifter game lobby

Tables for layout This is a clear and obvious misuse of the table element. Tables are for representing tabular data and that's it. Would that same content make sense in a spreadsheet? If the ...
• 3,624
Accepted

• 24.8k
Accepted

### A directive allowing to make a whole DOM subtree readonly

Generally speaking, you should avoid looking outside the current directive for anything that would affect your internal state (bar events). The preferred method of communication is scopes. Here is how ...
• 331

### AngularJS - REST + Authentication service

I think these are different layers of responsibility. The service.get('api.example.com/products'); is called in the controller to the corresponding view. What I ...
• 181

### Hangman learning AI

Here are a few general feedbacks: Have a coherent code style You're mixing multiple code styles sometimes you put spaces around operators ng-show='step == 0', ...
• 171

### AngularJS constants depending on other constants - any established patterns?

Using an IIFE seems to be the tidiest way I've found to do it. This allows you to define your constant as a function (that is immediately invoked) that returns your constant object so you can use it ...
• 161

### Improvements to an Angular ScrollSpy module

Nice work! I presume the complicated way of getting the right element measurements is to cater for many browsers, won't comment on that. I would add some comments on the nature of the 'magic number' ...
• 1,307
Accepted

### Filter an array of objects by an array in AngularJS

welcome to CodeReview :-) Firstly, I would mention that your $item and$model parameters should just be ...
• 3,753
Accepted

### Timer stop watch in AngularJS

Aside from the issue of setIntervals resolution/accuracy there's a lot of room for improvement in your angular. ...
• 16.6k
Accepted

### FizzBuzzLizardSpock

Very nice. I can't really see any major issues here, just some nits to pick. Note, though, that my knowledge of Angular is near-nil, so perhaps there's something there that someone else will be better ...
• 32.9k
Accepted

### Function to split full name into first & last

First of all, you should be aware that "first name" and "last name" are very tricky concepts. An example in that linked Wikipedia article is José Luis Rodríguez Zapatero. José Luis is the first name, ...
• 32.9k

### Baseball player statistics controller

Bearing in mind that you claim that you do not to maintain this code anymore1, there are a few suggestions I would have about this code: define functions and accept parameters- that should allow the ...
• 24.9k

• 1,307
Accepted

### Handling errors of nested promises

If I understand correctly, you can unnest your code, and catch any possible error at the end. That's the idea of using promises: ...
• 2,525

### MVC and Services

Angular is not exactly a MVC framework, it's a MVW - Model-View-Whatever. You can find an explanation here. The application has a good structure: Services to retrieve data from server Controller to ...
• 51
Accepted

### UI selector directives for an AngularJS invoicing module

Anything that makes each instance of a directive different should be delegated somewhere higher up. You make a "wrapper" directive. Generic logic stays down the hierarchy, while specific logic wraps ...
• 24.8k
Accepted

### Merging two arrays of objects with different keys/properties

When you merge two arrays, where the one array contains a key value, you can save a lot of time by indexing the keys. Consider an index on the array2 ...
• 96.7k
Accepted

### Handling rejected HTTP responses with status 401

I'd actually go a bit further than janos. He is perfectly right in that by repeatedly checking rejection.status, you're ...
• 524
Accepted

### Summarize JS Array more efficiently

I am also using MomentJS for formatting dates. I have experienced performance issues when using MomentJS before. It's not because it's terrible but rather the opposite. It just does a lot of things ...
• 24.8k