File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -474,28 +474,33 @@ function annotate(fn) {
474474 * constructor function that will be used to instantiate the service instance.
475475 *
476476 * 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.
478478 *
479479 * @param {string } name The name of the instance.
480480 * @param {Function } constructor A class (constructor function) that will be instantiated.
481481 * @returns {Object } registered provider instance
482482 *
483483 * @example
484484 * 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)}.
486486 * <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+ * }]);
493498 * </pre>
494499 * You would then inject and use this service like this:
495500 * <pre>
496- * someModule.controller 'Ctrl', ['ping', (ping) ->
497- * ping.send()
498- * ]
501+ * someModule.controller( 'Ctrl', ['ping', function (ping) {
502+ * ping.send();
503+ * }]);
499504 * </pre>
500505 */
501506
You can’t perform that action at this time.
0 commit comments