Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 57c37a2

Browse files
committed
doc(service): update docs for the moved services
1 parent 74fac45 commit 57c37a2

17 files changed

+116
-114
lines changed

src/service/compiler.js

+16-12
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ function $CompileProvider(){
7979

8080
/**
8181
* @ngdoc function
82-
* @name angular.compile
82+
* @name angular.module.NG.$compile
8383
* @function
8484
*
8585
* @description
@@ -97,16 +97,19 @@ function $CompileProvider(){
9797
* that is a DOM clone of the original template.
9898
*
9999
<pre>
100-
// compile the entire window.document and give me the scope bound to this template.
101-
var rootScope = angular.compile(window.document)();
100+
angular.injector('ng').invoke(null, function($rootScope, $compile) {
101+
// Chose one:
102102
103-
// compile a piece of html
104-
var rootScope2 = angular.compile('<div ng:click="clicked = true">click me</div>')();
103+
// A: compile the entire window.document.
104+
var element = $compile(window.document)($rootScope);
105105
106-
// compile a piece of html and retain reference to both the dom and scope
107-
var template = angular.element('<div ng:click="clicked = true">click me</div>'),
108-
scope = angular.compile(template)();
109-
// at this point template was transformed into a view
106+
// B: compile a piece of html
107+
var element = $compile('<div ng:click="clicked = true">click me</div>')($rootScope);
108+
109+
// C: compile a piece of html and retain reference to both the dom and scope
110+
var element = $compile('<div ng:click="clicked = true">click me</div>')(scope);
111+
// at this point template was transformed into a view
112+
});
110113
</pre>
111114
*
112115
*
@@ -140,8 +143,9 @@ function $CompileProvider(){
140143
* - If you are not asking the linking function to clone the template, create the DOM element(s)
141144
* before you send them to the compiler and keep this reference around.
142145
* <pre>
143-
* var scope = angular.injector()('$rootScope');
144-
* var element = angular.compile('<p>{{total}}</p>')(scope);
146+
* var scope = angular.injector('NG')(function($rootScope, $compile){
147+
* var element = $compile('<p>{{total}}</p>')($rootScope);
148+
* });
145149
* </pre>
146150
*
147151
* - if on the other hand, you need the element to be cloned, the view reference from the original
@@ -152,7 +156,7 @@ function $CompileProvider(){
152156
* scope = someParentScope.$new(),
153157
* clone;
154158
*
155-
* angular.compile(original)(scope, function(clonedElement, scope) {
159+
* $compile(original)(scope, function(clonedElement, scope) {
156160
* clone = clonedElement;
157161
* //attach the clone to DOM document at the right place
158162
* });

src/service/cookieStore.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
'use strict';
22

33
/**
4-
* @ngdoc service
5-
* @name angular.service.$cookieStore
4+
* @ngdoc object
5+
* @name angular.module.NG.$cookieStore
66
* @requires $cookies
77
*
88
* @description
@@ -17,8 +17,8 @@ function $CookieStoreProvider(){
1717
return {
1818
/**
1919
* @ngdoc method
20-
* @name angular.service.$cookieStore#get
21-
* @methodOf angular.service.$cookieStore
20+
* @name angular.module.NG.$cookieStore#get
21+
* @methodOf angular.module.NG.$cookieStore
2222
*
2323
* @description
2424
* Returns the value of given cookie key
@@ -32,8 +32,8 @@ function $CookieStoreProvider(){
3232

3333
/**
3434
* @ngdoc method
35-
* @name angular.service.$cookieStore#put
36-
* @methodOf angular.service.$cookieStore
35+
* @name angular.module.NG.$cookieStore#put
36+
* @methodOf angular.module.NG.$cookieStore
3737
*
3838
* @description
3939
* Sets a value for given cookie key
@@ -47,8 +47,8 @@ function $CookieStoreProvider(){
4747

4848
/**
4949
* @ngdoc method
50-
* @name angular.service.$cookieStore#remove
51-
* @methodOf angular.service.$cookieStore
50+
* @name angular.module.NG.$cookieStore#remove
51+
* @methodOf angular.module.NG.$cookieStore
5252
*
5353
* @description
5454
* Remove given cookie

src/service/cookies.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
'use strict';
22

33
/**
4-
* @ngdoc service
5-
* @name angular.service.$cookies
4+
* @ngdoc object
5+
* @name angular.module.NG.$cookies
66
* @requires $browser
77
*
88
* @description

src/service/defer.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
'use strict';
22

33
/**
4-
* @ngdoc service
5-
* @name angular.service.$defer
4+
* @ngdoc function
5+
* @name angular.module.NG.$defer
66
* @requires $browser
77
*
88
* @description
9-
* Delegates to {@link angular.service.$browser $browser.defer}, but wraps the `fn` function
9+
* Delegates to {@link angular.module.NG.$browser#defer $browser.defer}, but wraps the `fn` function
1010
* into a try/catch block and delegates any exceptions to
11-
* {@link angular.service.$exceptionHandler $exceptionHandler} service.
11+
* {@link angular.module.NG.$exceptionHandler $exceptionHandler} service.
1212
*
1313
* In tests you can use `$browser.defer.flush()` to flush the queue of deferred functions.
1414
*
@@ -19,8 +19,8 @@
1919

2020
/**
2121
* @ngdoc function
22-
* @name angular.service.$defer#cancel
23-
* @methodOf angular.service.$defer
22+
* @name angular.module.NG.$defer#cancel
23+
* @methodOf angular.module.NG.$defer
2424
*
2525
* @description
2626
* Cancels a defered task identified with `deferId`.

src/service/document.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
'use strict';
22

33
/**
4-
* @ngdoc service
5-
* @name angular.service.$document
4+
* @ngdoc object
5+
* @name angular.module.NG.$document
66
* @requires $window
77
*
88
* @description

src/service/exceptionHandler.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
'use strict';
22

33
/**
4-
* @ngdoc service
5-
* @name angular.service.$exceptionHandler
4+
* @ngdoc function
5+
* @name angular.module.NG.$exceptionHandler
66
* @requires $log
77
*
88
* @description
@@ -12,8 +12,6 @@
1212
*
1313
* In unit tests, if `angular-mocks.js` is loaded, this service is overriden by
1414
* {@link angular.module.NG_MOCK.$exceptionHandler mock $exceptionHandler}
15-
*
16-
* @example
1715
*/
1816
function $ExceptionHandlerProvider(){
1917
this.$get = ['$log', function($log){

src/service/location.js

+20-20
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,8 @@ LocationUrl.prototype = LocationHashbangUrl.prototype = {
205205

206206
/**
207207
* @ngdoc method
208-
* @name angular.service.$location#absUrl
209-
* @methodOf angular.service.$location
208+
* @name angular.module.NG.$location#absUrl
209+
* @methodOf angular.module.NG.$location
210210
*
211211
* @description
212212
* This method is getter only.
@@ -220,8 +220,8 @@ LocationUrl.prototype = LocationHashbangUrl.prototype = {
220220

221221
/**
222222
* @ngdoc method
223-
* @name angular.service.$location#url
224-
* @methodOf angular.service.$location
223+
* @name angular.module.NG.$location#url
224+
* @methodOf angular.module.NG.$location
225225
*
226226
* @description
227227
* This method is getter / setter.
@@ -246,8 +246,8 @@ LocationUrl.prototype = LocationHashbangUrl.prototype = {
246246

247247
/**
248248
* @ngdoc method
249-
* @name angular.service.$location#protocol
250-
* @methodOf angular.service.$location
249+
* @name angular.module.NG.$location#protocol
250+
* @methodOf angular.module.NG.$location
251251
*
252252
* @description
253253
* This method is getter only.
@@ -260,8 +260,8 @@ LocationUrl.prototype = LocationHashbangUrl.prototype = {
260260

261261
/**
262262
* @ngdoc method
263-
* @name angular.service.$location#host
264-
* @methodOf angular.service.$location
263+
* @name angular.module.NG.$location#host
264+
* @methodOf angular.module.NG.$location
265265
*
266266
* @description
267267
* This method is getter only.
@@ -274,8 +274,8 @@ LocationUrl.prototype = LocationHashbangUrl.prototype = {
274274

275275
/**
276276
* @ngdoc method
277-
* @name angular.service.$location#port
278-
* @methodOf angular.service.$location
277+
* @name angular.module.NG.$location#port
278+
* @methodOf angular.module.NG.$location
279279
*
280280
* @description
281281
* This method is getter only.
@@ -288,8 +288,8 @@ LocationUrl.prototype = LocationHashbangUrl.prototype = {
288288

289289
/**
290290
* @ngdoc method
291-
* @name angular.service.$location#path
292-
* @methodOf angular.service.$location
291+
* @name angular.module.NG.$location#path
292+
* @methodOf angular.module.NG.$location
293293
*
294294
* @description
295295
* This method is getter / setter.
@@ -310,8 +310,8 @@ LocationUrl.prototype = LocationHashbangUrl.prototype = {
310310

311311
/**
312312
* @ngdoc method
313-
* @name angular.service.$location#search
314-
* @methodOf angular.service.$location
313+
* @name angular.module.NG.$location#search
314+
* @methodOf angular.module.NG.$location
315315
*
316316
* @description
317317
* This method is getter / setter.
@@ -343,8 +343,8 @@ LocationUrl.prototype = LocationHashbangUrl.prototype = {
343343

344344
/**
345345
* @ngdoc method
346-
* @name angular.service.$location#hash
347-
* @methodOf angular.service.$location
346+
* @name angular.module.NG.$location#hash
347+
* @methodOf angular.module.NG.$location
348348
*
349349
* @description
350350
* This method is getter / setter.
@@ -360,8 +360,8 @@ LocationUrl.prototype = LocationHashbangUrl.prototype = {
360360

361361
/**
362362
* @ngdoc method
363-
* @name angular.service.$location#replace
364-
* @methodOf angular.service.$location
363+
* @name angular.module.NG.$location#replace
364+
* @methodOf angular.module.NG.$location
365365
*
366366
* @description
367367
* If called, all changes to $location during current `$digest` will be replacing current history
@@ -395,8 +395,8 @@ function locationGetterSetter(property, preprocess) {
395395

396396

397397
/**
398-
* @ngdoc service
399-
* @name angular.service.$location
398+
* @ngdoc object
399+
* @name angular.module.NG.$location
400400
*
401401
* @requires $browser
402402
* @requires $sniffer

src/service/log.js

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
'use strict';
22

33
/**
4-
* @ngdoc service
5-
* @name angular.service.$log
4+
* @ngdoc object
5+
* @name angular.module.NG.$log
66
* @requires $window
77
*
88
* @description
@@ -40,8 +40,8 @@ function $LogProvider(){
4040
return {
4141
/**
4242
* @ngdoc method
43-
* @name angular.service.$log#log
44-
* @methodOf angular.service.$log
43+
* @name angular.module.NG.$log#log
44+
* @methodOf angular.module.NG.$log
4545
*
4646
* @description
4747
* Write a log message
@@ -50,8 +50,8 @@ function $LogProvider(){
5050

5151
/**
5252
* @ngdoc method
53-
* @name angular.service.$log#warn
54-
* @methodOf angular.service.$log
53+
* @name angular.module.NG.$log#warn
54+
* @methodOf angular.module.NG.$log
5555
*
5656
* @description
5757
* Write a warning message
@@ -60,8 +60,8 @@ function $LogProvider(){
6060

6161
/**
6262
* @ngdoc method
63-
* @name angular.service.$log#info
64-
* @methodOf angular.service.$log
63+
* @name angular.module.NG.$log#info
64+
* @methodOf angular.module.NG.$log
6565
*
6666
* @description
6767
* Write an information message
@@ -70,8 +70,8 @@ function $LogProvider(){
7070

7171
/**
7272
* @ngdoc method
73-
* @name angular.service.$log#error
74-
* @methodOf angular.service.$log
73+
* @name angular.module.NG.$log#error
74+
* @methodOf angular.module.NG.$log
7575
*
7676
* @description
7777
* Write an error message

src/service/resource.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
'use strict';
22

33
/**
4-
* @ngdoc service
5-
* @name angular.service.$resource
4+
* @ngdoc object
5+
* @name angular.module.NG.$resource
66
* @requires $xhr.cache
77
*
88
* @description
99
* A factory which creates a resource object that lets you interact with
1010
* [RESTful](http://en.wikipedia.org/wiki/Representational_State_Transfer) server-side data sources.
1111
*
1212
* The returned resource object has action methods which provide high-level behaviors without
13-
* the need to interact with the low level {@link angular.service.$xhr $xhr} service or
13+
* the need to interact with the low level {@link angular.module.NG.$xhr $xhr} service or
1414
* raw XMLHttpRequest.
1515
*
1616
* @param {string} url A parameterized URL template with parameters prefixed by `:` as in
@@ -57,7 +57,7 @@
5757
* 'remove': {method:'DELETE'},
5858
* 'delete': {method:'DELETE'} };
5959
*
60-
* Calling these methods invoke an {@link angular.service.$xhr} with the specified http method,
60+
* Calling these methods invoke an {@link angular.module.NG.$xhr} with the specified http method,
6161
* destination and parameters. When the data is returned from the server then the object is an
6262
* instance of the resource class `save`, `remove` and `delete` actions are available on it as
6363
* methods with the `$` prefix. This allows you to easily perform CRUD operations (create, read,

0 commit comments

Comments
 (0)