cmathew / progress-indicator

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feedback

diwu1989 opened this issue · comments

commented
  • there's a $interval service that is digest friendly
  • the d3.select('.progress-indicator') looks dangerous because it's not restricted to the element
  • css colors are better off in a .css file and designated as classes
  • '@' isolate scope is not as flexible as '&' isolate scope, you can't use expressions with '@'
  • tabs vs spaces
  • tests for the directive
  • using a svg viewbox to support scaling up arbitrarily
  • jshint

Thanks for looking, @diwu1989! All good comments, definitely some work to do before I see y'all on Wednesday.

1.) totally, can't believe I forgot about $interval. A misplaced $scope.$apply can kill your program if a digest is already in progress.

2.) was aware that it would select any/all, just didn't think it mattered for this project. Now that you say it, though, it IS supposed to be a self-contained directive!

3.) completely. I guess I was trying to keep my SVG stuff inside d3, but color is purely presentation layer so CSS is the place.

4.) ultimately ended up using attrs in place of scope, but will take a look

5.) sorry..using Notepad++ as my IDE for this one 💣

6.) although the problem said these were optional, I'd certainly be willing to do them

7.) considered this, but to be (very) honest my experience with SVG is limited and I didn't want to risk everything on it

8.) yep, there are probably some double equals and single quotes floating around in there.

commented

i think one things to keep in mind with animation once you move all that logic into the directive is what to do about variable changes mid-animation. The case to consider is just to make sure that the arcs animate to the correct target length from its current location (mid-animation).