angucomplete icon indicating copy to clipboard operation
angucomplete copied to clipboard

Eval?

Open davidchase opened this issue 11 years ago • 4 comments

I found your autocomplete via ngModules its pretty sweet! & easy to use..

But my question is, what was the reasoning behind using eval when you can just use bracket notation instead and achieve the same results instead of sprinkling eval around?

Thanks -David

davidchase avatar Feb 03 '14 22:02 davidchase

+1 you should not use eval.

toutpt avatar Feb 04 '14 15:02 toutpt

From what I can tell, the eval allows arbitrarily long chains of "dot notation". If we had list comprehensions, or by brute-forcing a for loop, the same thing could be achieved by split('.')-ing and then using bracket notation.

stevenharman avatar Feb 04 '14 21:02 stevenharman

Yeah I agree, had meant to remove the eval but completely forgot it was still in there. Will fix it tomorrow. Cheers guys.

Daryl.

Sent from my iPhone

On 4 Feb 2014, at 21:32, Steven Harman [email protected] wrote:

From what I can tell, the eval allows arbitrarily long chains of "dot notation". If we had list comprehensions, or by brute-forcing a for loop the same thing could be achieved by split('.')-ing and then using bracket notation.

— Reply to this email directly or view it on GitHub.

darylrowland avatar Feb 04 '14 22:02 darylrowland

Yeah I was just curious because in my implementation I subbed out the eval with bracket notation and all is well :)

davidchase avatar Feb 05 '14 02:02 davidchase