From e324c149077d99cb722ab3b9e05759cb4dfa07a9 Mon Sep 17 00:00:00 2001 From: Lukas Ruebbelke Date: Wed, 8 Jan 2014 21:54:39 -0500 Subject: docs(provider): replaced coffeescript with comparable javascript example --- src/auto/injector.js | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/auto/injector.js b/src/auto/injector.js index a04ff1e6..b14b8af2 100644 --- a/src/auto/injector.js +++ b/src/auto/injector.js @@ -474,7 +474,7 @@ function annotate(fn) { * constructor function that will be used to instantiate the service instance. * * You should use {@link AUTO.$provide#methods_service $provide.service(class)} if you define your service - * as a type/class. This is common when using {@link http://coffeescript.org CoffeeScript}. + * as a type/class. * * @param {string} name The name of the instance. * @param {Function} constructor A class (constructor function) that will be instantiated. @@ -482,20 +482,25 @@ function annotate(fn) { * * @example * Here is an example of registering a service using - * {@link AUTO.$provide#methods_service $provide.service(class)} that is defined as a CoffeeScript class. + * {@link AUTO.$provide#methods_service $provide.service(class)}. *
- *   class Ping
- *     constructor: (@$http) ->
- *     send: () =>
- *       @$http.get('/ping')
- *
- *   $provide.service('ping', ['$http', Ping])
+ *   $provide.service('ping', ['$http', function($http) {
+ *     var Ping = function() {
+ *       this.$http = $http;
+ *     };
+ *   
+ *     Ping.prototype.send = function() {
+ *       return this.$http.get('/ping');
+ *     }; 
+ *   
+ *     return Ping;
+ *   }]);
  * 
* You would then inject and use this service like this: *
- *   someModule.controller 'Ctrl', ['ping', (ping) ->
- *     ping.send()
- *   ]
+ *   someModule.controller('Ctrl', ['ping', function(ping) {
+ *     ping.send();
+ *   }]);
  * 
*/ -- cgit v1.2.3