Skip to content

Controllers, why doesn't possible inject services? #645

Answered by douglasfdev
douglasfdev asked this question in Q&A
Discussion options

You must be logged in to vote

Now that I have more experience in JavaScript, I remember hearing that JavaScript doesn't have classes natively, it works with prototypes.

Then I also remembered that when you have callbacks using this, JavaScript can get lost as to who this is.

Then I remembered .bind() or inferring in the routing the correct call of the object together with the method that returns something.

So this doesn't get lost.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by douglasfdev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant
Converted from issue

This discussion was converted from issue #644 on March 17, 2024 21:52.