documentation of angular.mock.inject

23 views
Skip to first unread message

see more glass

unread,
May 9, 2014, 11:16:46 AM5/9/14
to ang...@googlegroups.com
I am not happy with the angularjs documentation. As an example I mention the doc for angular.mock.inject (https://docs.angularjs.org/api/ngMock/function/angular.mock.inject). Could someone please answer my questions and possibly alter the documentation? Or tell my why I am too stupid to understand it:

The inject function wraps a function into an injectable function


I don't think that wrap into is a correct English phrase, but I am no English native speaker. What does it mean? embedded into? I understand that an injectable function is created, what is its purpose and how is it used?

The inject() creates new instance of $injector per test

I thought the beforeEach function is responsible for initialization for each test, so there is no need to call it inside of beforeEach() ???

which is then used for resolving references

When is it used? How is it used, automatically or not? What is a reference, a string, a variable, a ... ?

Since it is available in the function body as myService, we can then assign it to a variable defined in an outer scope.

No, it is available as _myService_ , thats the trick a thought.

mark prades

unread,
May 12, 2014, 7:40:30 AM5/12/14
to ang...@googlegroups.com
 Yeah the doc needs serious editing,but it has always been like this.

The problem is the doc is embedded in the source code thus written by developpers.

While it's an elegant system,having to make a pull request on angular source code to change the doc is madness.

The api documentation should be decoupled from its code. 
Reply all
Reply to author
Forward
0 new messages