Advertisement
Guest User

Untitled

a guest
Oct 8th, 2015
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1. /**
  2. * @ngdoc service
  3. * @name myApp.service:myService
  4. * @description
  5. * My application.
  6. */
  7. angular
  8. .module('myApp')
  9. .factory('myService', function() {
  10. 'use strict';
  11.  
  12. var x = 0;
  13.  
  14. /**
  15. * @ngdoc function
  16. * @name ?
  17. * @description
  18. * How can this be identified as being within the closure of
  19. * myService, and not be described as a constructor?
  20. */
  21. function myFunction (z) {
  22. x++;
  23. x += z;
  24. }
  25.  
  26. return {
  27. /**
  28. * @ngdoc method
  29. * @name myMethod
  30. * @methodOf myApp.service:myService
  31. * @description
  32. * A method of myService.
  33. */
  34. myMethod : function (x) {
  35. myFunction(x);
  36. }
  37. };
  38. })
  39.  
  40. /**
  41. * @ngdoc overview
  42. * @name module
  43. * @description A small module containing stuff
  44. */
  45. angular
  46. .module(module, [])
  47. .factory('name', factory);
  48.  
  49. /**
  50. * @ngdoc object
  51. * @name module.name
  52. * @description Its a pretty bad factory
  53. */
  54. function factory() {
  55. return {
  56. doSomething: doSomething
  57. };
  58.  
  59. /**
  60. * @ngdoc function
  61. * @name module.name#doSomething
  62. * @methodOf module.name
  63. * @description Does the thing
  64. * @param {string=} [foo='bar'] This is a parameter that does nothing, it is
  65. optional and defaults to 'bar'
  66. * @returns {undefined} It doesn't return
  67. */
  68. function doSomething(foo){...}
  69. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement