injectables.js 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368
  1. "use strict";
  2. /**
  3. * # Angular 1 injectable services
  4. *
  5. * This is a list of the objects which can be injected using angular's injector.
  6. *
  7. * There are three different kind of injectable objects:
  8. *
  9. * ## **Provider** objects
  10. * #### injectable into a `.config()` block during configtime
  11. *
  12. * - [[$uiRouterProvider]]: The UI-Router instance
  13. * - [[$stateProvider]]: State registration
  14. * - [[$transitionsProvider]]: Transition hooks
  15. * - [[$urlServiceProvider]]: All URL related public APIs
  16. *
  17. * - [[$uiViewScrollProvider]]: Disable ui-router view scrolling
  18. * - [[$urlRouterProvider]]: (deprecated) Url matching rules
  19. * - [[$urlMatcherFactoryProvider]]: (deprecated) Url parsing config
  20. *
  21. * ## **Service** objects
  22. * #### injectable globally during runtime
  23. *
  24. * - [[$uiRouter]]: The UI-Router instance
  25. * - [[$trace]]: Enable transition trace/debug
  26. * - [[$transitions]]: Transition hooks
  27. * - [[$state]]: Imperative state related APIs
  28. * - [[$stateRegistry]]: State registration
  29. * - [[$urlService]]: All URL related public APIs
  30. * - [[$uiRouterGlobals]]: Global variables
  31. * - [[$uiViewScroll]]: Scroll an element into view
  32. *
  33. * - [[$stateParams]]: (deprecated) Global state param values
  34. * - [[$urlRouter]]: (deprecated) URL synchronization
  35. * - [[$urlMatcherFactory]]: (deprecated) URL parsing config
  36. *
  37. * ## **Per-Transition** objects
  38. *
  39. * - These kind of objects are injectable into:
  40. * - Resolves ([[Ng1StateDeclaration.resolve]]),
  41. * - Transition Hooks ([[TransitionService.onStart]], etc),
  42. * - Routed Controllers ([[Ng1ViewDeclaration.controller]])
  43. *
  44. * #### Different instances are injected based on the [[Transition]]
  45. *
  46. * - [[$transition$]]: The current Transition object
  47. * - [[$stateParams]]: State param values for pending Transition (deprecated)
  48. * - Any resolve data defined using [[Ng1StateDeclaration.resolve]]
  49. *
  50. * @ng1api
  51. * @preferred
  52. * @module injectables
  53. */ /** */
  54. Object.defineProperty(exports, "__esModule", { value: true });
  55. /**
  56. * The current (or pending) State Parameters
  57. *
  58. * An injectable global **Service Object** which holds the state parameters for the latest **SUCCESSFUL** transition.
  59. *
  60. * The values are not updated until *after* a `Transition` successfully completes.
  61. *
  62. * **Also:** an injectable **Per-Transition Object** object which holds the pending state parameters for the pending `Transition` currently running.
  63. *
  64. * ### Deprecation warning:
  65. *
  66. * The value injected for `$stateParams` is different depending on where it is injected.
  67. *
  68. * - When injected into an angular service, the object injected is the global **Service Object** with the parameter values for the latest successful `Transition`.
  69. * - When injected into transition hooks, resolves, or view controllers, the object is the **Per-Transition Object** with the parameter values for the running `Transition`.
  70. *
  71. * Because of these confusing details, this service is deprecated.
  72. *
  73. * ### Instead of using the global `$stateParams` service object,
  74. * inject [[$uiRouterGlobals]] and use [[UIRouterGlobals.params]]
  75. *
  76. * ```js
  77. * MyService.$inject = ['$uiRouterGlobals'];
  78. * function MyService($uiRouterGlobals) {
  79. * return {
  80. * paramValues: function () {
  81. * return $uiRouterGlobals.params;
  82. * }
  83. * }
  84. * }
  85. * ```
  86. *
  87. * ### Instead of using the per-transition `$stateParams` object,
  88. * inject the current `Transition` (as [[$transition$]]) and use [[Transition.params]]
  89. *
  90. * ```js
  91. * MyController.$inject = ['$transition$'];
  92. * function MyController($transition$) {
  93. * var username = $transition$.params().username;
  94. * // .. do something with username
  95. * }
  96. * ```
  97. *
  98. * ---
  99. *
  100. * This object can be injected into other services.
  101. *
  102. * #### Deprecated Example:
  103. * ```js
  104. * SomeService.$inject = ['$http', '$stateParams'];
  105. * function SomeService($http, $stateParams) {
  106. * return {
  107. * getUser: function() {
  108. * return $http.get('/api/users/' + $stateParams.username);
  109. * }
  110. * }
  111. * };
  112. * angular.service('SomeService', SomeService);
  113. * ```
  114. * @deprecated
  115. */
  116. var $stateParams;
  117. /**
  118. * Global UI-Router variables
  119. *
  120. * The router global state as a **Service Object** (injectable during runtime).
  121. *
  122. * This object contains globals such as the current state and current parameter values.
  123. */
  124. var $uiRouterGlobals;
  125. /**
  126. * The UI-Router instance
  127. *
  128. * The [[UIRouter]] singleton (the router instance) as a **Service Object** (injectable during runtime).
  129. *
  130. * This object is the UI-Router singleton instance, created by angular dependency injection during application bootstrap.
  131. * It has references to the other UI-Router services
  132. *
  133. * #### Note: This object is also exposed as [[$uiRouterProvider]] for injection during angular config time.
  134. */
  135. var $uiRouter;
  136. /**
  137. * The UI-Router instance
  138. *
  139. * The [[UIRouter]] singleton (the router instance) as a **Provider Object** (injectable during config phase).
  140. *
  141. * This object is the UI-Router singleton instance, created by angular dependency injection during application bootstrap.
  142. * It has references to the other UI-Router services
  143. *
  144. * #### Note: This object is also exposed as [[$uiRouter]] for injection during runtime.
  145. */
  146. var $uiRouterProvider;
  147. /**
  148. * Transition debug/tracing
  149. *
  150. * The [[Trace]] singleton as a **Service Object** (injectable during runtime).
  151. *
  152. * Enables or disables Transition tracing which can help to debug issues.
  153. */
  154. var $trace;
  155. /**
  156. * The Transition Service
  157. *
  158. * The [[TransitionService]] singleton as a **Service Object** (injectable during runtime).
  159. *
  160. * This angular service exposes the [[TransitionService]] singleton, which is primarily
  161. * used to register global transition hooks.
  162. *
  163. * #### Note: This object is also exposed as [[$transitionsProvider]] for injection during the config phase.
  164. */
  165. var $transitions;
  166. /**
  167. * The Transition Service
  168. *
  169. * The [[TransitionService]] singleton as a **Provider Object** (injectable during config phase)
  170. *
  171. * This angular service exposes the [[TransitionService]] singleton, which is primarily
  172. * used to register global transition hooks.
  173. *
  174. * #### Note: This object is also exposed as [[$transitions]] for injection during runtime.
  175. */
  176. var $transitionsProvider;
  177. /**
  178. * The current [[Transition]] object
  179. *
  180. * The current [[Transition]] object as a **Per-Transition Object** (injectable into Resolve, Hooks, Controllers)
  181. *
  182. * This object returns information about the current transition, including:
  183. *
  184. * - To/from states
  185. * - To/from parameters
  186. * - Transition options
  187. * - States being entered, exited, and retained
  188. * - Resolve data
  189. * - A Promise for the transition
  190. * - Any transition failure information
  191. * - An injector for both Service and Per-Transition Objects
  192. */
  193. var $transition$;
  194. /**
  195. * The State Service
  196. *
  197. * The [[StateService]] singleton as a **Service Object** (injectable during runtime).
  198. *
  199. * This service used to manage and query information on registered states.
  200. * It exposes state related APIs including:
  201. *
  202. * - Start a [[Transition]]
  203. * - Imperatively lazy load states
  204. * - Check if a state is currently active
  205. * - Look up states by name
  206. * - Build URLs for a state+parameters
  207. * - Configure the global Transition error handler
  208. *
  209. * This angular service exposes the [[StateService]] singleton.
  210. */
  211. var $state;
  212. /**
  213. * The State Registry
  214. *
  215. * The [[StateRegistry]] singleton as a **Service Object** (injectable during runtime).
  216. *
  217. * This service is used to register/deregister states.
  218. * It has state registration related APIs including:
  219. *
  220. * - Register/deregister states
  221. * - Listen for state registration/deregistration
  222. * - Get states by name
  223. * - Add state decorators (to customize the state creation process)
  224. *
  225. * #### Note: This object is also exposed as [[$stateRegistryProvider]] for injection during the config phase.
  226. */
  227. var $stateRegistry;
  228. /**
  229. * The State Registry
  230. *
  231. * The [[StateRegistry]] singleton as a **Provider Object** (injectable during config time).
  232. *
  233. * This service is used to register/deregister states.
  234. * It has state registration related APIs including:
  235. *
  236. * - Register/deregister states
  237. * - Listen for state registration/deregistration
  238. * - Get states by name
  239. * - Add state decorators (to customize the state creation process)
  240. *
  241. * #### Note: This object is also exposed as [[$stateRegistry]] for injection during runtime.
  242. */
  243. var $stateRegistryProvider;
  244. /**
  245. * The View Scroll provider
  246. *
  247. * The [[UIViewScrollProvider]] as a **Provider Object** (injectable during config time).
  248. *
  249. * This angular service exposes the [[UIViewScrollProvider]] singleton and is
  250. * used to disable UI-Router's scroll behavior.
  251. */
  252. var $uiViewScrollProvider;
  253. /**
  254. * The View Scroll function
  255. *
  256. * The View Scroll function as a **Service Object** (injectable during runtime).
  257. *
  258. * This is a function that scrolls an element into view.
  259. * The element is scrolled after a `$timeout` so the DOM has time to refresh.
  260. *
  261. * If you prefer to rely on `$anchorScroll` to scroll the view to the anchor,
  262. * this can be enabled by calling [[UIViewScrollProvider.useAnchorScroll]].
  263. *
  264. * Note: this function is used by the [[directives.uiView]] when the `autoscroll` expression evaluates to true.
  265. */
  266. var $uiViewScroll;
  267. /**
  268. * The StateProvider
  269. *
  270. * An angular1-only [[StateProvider]] as a **Provider Object** (injectable during config time).
  271. *
  272. * This angular service exposes the [[StateProvider]] singleton.
  273. *
  274. * The `StateProvider` is primarily used to register states or add custom state decorators.
  275. *
  276. * ##### Note: This provider is a ng1 vestige.
  277. * It is a passthrough to [[$stateRegistry]] and [[$state]].
  278. */
  279. var $stateProvider;
  280. /**
  281. * The URL Service Provider
  282. *
  283. * The [[UrlService]] singleton as a **Provider Object** (injectable during the angular config phase).
  284. *
  285. * A service used to configure and interact with the URL.
  286. * It has URL related APIs including:
  287. *
  288. * - register custom Parameter types `UrlService.config.type` ([[UrlConfigApi.type]])
  289. * - add URL rules: `UrlService.rules.when` ([[UrlRulesApi.when]])
  290. * - configure behavior when no url matches: `UrlService.rules.otherwise` ([[UrlRulesApi.otherwise]])
  291. * - delay initial URL synchronization [[UrlService.deferIntercept]].
  292. * - get or set the current url: [[UrlService.url]]
  293. *
  294. * ##### Note: This service can also be injected during runtime as [[$urlService]].
  295. */
  296. var $urlServiceProvider;
  297. /**
  298. * The URL Service
  299. *
  300. * The [[UrlService]] singleton as a **Service Object** (injectable during runtime).
  301. *
  302. * Note: This service can also be injected during the config phase as [[$urlServiceProvider]].
  303. *
  304. * Used to configure the URL.
  305. * It has URL related APIs including:
  306. *
  307. * - register custom Parameter types `UrlService.config.type` ([[UrlConfigApi.type]])
  308. * - add URL rules: `UrlService.rules.when` ([[UrlRulesApi.when]])
  309. * - configure behavior when no url matches: `UrlService.rules.otherwise` ([[UrlRulesApi.otherwise]])
  310. * - delay initial URL synchronization [[UrlService.deferIntercept]].
  311. * - get or set the current url: [[UrlService.url]]
  312. *
  313. * ##### Note: This service can also be injected during the config phase as [[$urlServiceProvider]].
  314. */
  315. var $urlService;
  316. /**
  317. * The URL Router Provider
  318. *
  319. * ### Deprecation warning: This object is now considered internal. Use [[$urlServiceProvider]] instead.
  320. *
  321. * The [[UrlRouter]] singleton as a **Provider Object** (injectable during config time).
  322. *
  323. * #### Note: This object is also exposed as [[$urlRouter]] for injection during runtime.
  324. *
  325. * @deprecated
  326. */
  327. var $urlRouterProvider;
  328. /**
  329. * The Url Router
  330. *
  331. * ### Deprecation warning: This object is now considered internal. Use [[$urlService]] instead.
  332. *
  333. * The [[UrlRouter]] singleton as a **Service Object** (injectable during runtime).
  334. *
  335. * #### Note: This object is also exposed as [[$urlRouterProvider]] for injection during angular config time.
  336. *
  337. * @deprecated
  338. */
  339. var $urlRouter;
  340. /**
  341. * The URL Matcher Factory
  342. *
  343. * ### Deprecation warning: This object is now considered internal. Use [[$urlService]] instead.
  344. *
  345. * The [[UrlMatcherFactory]] singleton as a **Service Object** (injectable during runtime).
  346. *
  347. * This service is used to set url mapping options, define custom parameter types, and create [[UrlMatcher]] objects.
  348. *
  349. * #### Note: This object is also exposed as [[$urlMatcherFactoryProvider]] for injection during angular config time.
  350. *
  351. * @deprecated
  352. */
  353. var $urlMatcherFactory;
  354. /**
  355. * The URL Matcher Factory
  356. *
  357. * ### Deprecation warning: This object is now considered internal. Use [[$urlService]] instead.
  358. *
  359. * The [[UrlMatcherFactory]] singleton as a **Provider Object** (injectable during config time).
  360. *
  361. * This service is used to set url mapping options, define custom parameter types, and create [[UrlMatcher]] objects.
  362. *
  363. * #### Note: This object is also exposed as [[$urlMatcherFactory]] for injection during runtime.
  364. *
  365. * @deprecated
  366. */
  367. var $urlMatcherFactoryProvider;
  368. //# sourceMappingURL=injectables.js.map