File tree Expand file tree Collapse file tree 1 file changed +16
-11
lines changed Expand file tree Collapse file tree 1 file changed +16
-11
lines changed Original file line number Diff line number Diff line change @@ -474,28 +474,33 @@ function annotate(fn) {
474
474
* constructor function that will be used to instantiate the service instance.
475
475
*
476
476
* You should use {@link AUTO.$provide#methods_service $provide.service(class)} if you define your service
477
- * as a type/class. This is common when using { @link http://coffeescript.org CoffeeScript}.
477
+ * as a type/class.
478
478
*
479
479
* @param {string } name The name of the instance.
480
480
* @param {Function } constructor A class (constructor function) that will be instantiated.
481
481
* @returns {Object } registered provider instance
482
482
*
483
483
* @example
484
484
* Here is an example of registering a service using
485
- * {@link AUTO.$provide#methods_service $provide.service(class)} that is defined as a CoffeeScript class .
485
+ * {@link AUTO.$provide#methods_service $provide.service(class)}.
486
486
* <pre>
487
- * class Ping
488
- * constructor: (@$http) ->
489
- * send: () =>
490
- * @$http.get('/ping')
491
- *
492
- * $provide.service('ping', ['$http', Ping])
487
+ * $provide.service('ping', ['$http', function($http) {
488
+ * var Ping = function() {
489
+ * this.$http = $http;
490
+ * };
491
+ *
492
+ * Ping.prototype.send = function() {
493
+ * return this.$http.get('/ping');
494
+ * };
495
+ *
496
+ * return Ping;
497
+ * }]);
493
498
* </pre>
494
499
* You would then inject and use this service like this:
495
500
* <pre>
496
- * someModule.controller 'Ctrl', ['ping', (ping) ->
497
- * ping.send()
498
- * ]
501
+ * someModule.controller( 'Ctrl', ['ping', function (ping) {
502
+ * ping.send();
503
+ * }]);
499
504
* </pre>
500
505
*/
501
506
You can’t perform that action at this time.
0 commit comments