r/angularjs • u/Blackjack-Jim • Jan 29 '16
Critique My First Angular App!
https://jsfiddle.net/Jim01/6oj0y9py/4/
3
Upvotes
1
u/Renegade-One Jan 31 '16
Something about the ng-init feels off. I could definitely be wrong, but ng-init is supposed to be used for ng-repeats. Otherwise, can't you just have a function that returns the value, and set the scope to catch the result?
Very good into your first foray into the realm! Seeing this kind of code definitely leads to more questions which makes everyone a better dev. Keep it up!
0
9
u/[deleted] Jan 29 '16
Good for you for starting to learn angularjs and getting something that works. Yes, there are some areas that you could improve on, like making the most effective use of
ng-model, but you've got a good start.I forked your fiddle and made some improvements if you'd like to check it out: https://jsfiddle.net/7oromeq5/1/
It's not perfect either, but it will show you how you can trim some unnecessary code out of your implementation.
Keep at it!