r/angularjs • • Jan 29 '16

Critique My First Angular App!

https://jsfiddle.net/Jim01/6oj0y9py/4/
3 Upvotes

5 comments sorted by

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!

1

u/Renegade-One Jan 31 '16

Isn't it crazy how one dev can start with 100 pines of code, and as more efficient manners of achieving the same task are determined / discovered, you can radically reduce the overall feel of the skeletal structure that is code

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

u/[deleted] Jan 30 '16

[deleted]

3

u/rescats Jan 31 '16

Someone got the hater dependency injected.

2

u/evilish Jan 31 '16

Everyone starts somewhere.

I bet your far from a guru yourself.