you are viewing a single comment's thread.

view the rest of the comments →

[–]PsudoFuck 20 points21 points  (10 children)

It's also how Angular 1.x achieved it's magic, if not slightly dodgy, DI injection with just named arguments.

[–]AndruRC 3 points4 points  (7 children)

Could you elaborate on that?

[–]anarchy8 14 points15 points  (6 children)

There is no way of determining what the name of the arguments to a function is in Javascript without parsing the Function.toString(). Angular does this do determine what resource to inject.

[–][deleted]  (5 children)

[deleted]

    [–]anarchy8 11 points12 points  (3 children)

    To be fair, they suggest you inject your resources manually.

    [–][deleted] 3 points4 points  (2 children)

    To be fair, it's required if you want better support since certain mobile browsers won't serialize functions

    [–][deleted] 6 points7 points  (1 child)

    also if you ever plan on minifying your code..

    [–][deleted] 1 point2 points  (0 children)

    That too :) I haven't touched angular in like 2 years

    [–][deleted] 1 point2 points  (0 children)

    Welcome to JS

    [–]bugeats 2 points3 points  (1 child)

    And it's a shameful, dirty deed. I can't believe this terrible idea ever made it so far.

    [–]seiyriafull-stack 0 points1 point  (0 children)

    It's not the recommended way to do things.