toddmotto / ama

Ask me anything!
20 stars 3 forks source link

Which is your preferred method of dependency injection? #35

Closed timothylombrana closed 8 years ago

timothylombrana commented 8 years ago

$Inject vs @ngInject: Which is your preferred and most performant choice on dependency inject? For production large scale application.

toddmotto commented 8 years ago

If I'm not mistaken, @ngInject will annotate the functions for you (sometimes using $inject or the Array syntax), whereas $inject is something you'd do yourself and is faster. See this for more, I broke down the process: https://toddmotto.com/angular-js-dependency-injection-annotation-process/

timothylombrana commented 8 years ago

Thanks Todd! Much appreciated, great article.

toddmotto commented 8 years ago

Anytime! :)