a zip code crypto-currency system good for red ONLY

ionic-page.js 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  1. (function (factory) {
  2. if (typeof module === "object" && typeof module.exports === "object") {
  3. var v = factory(require, exports);
  4. if (v !== undefined) module.exports = v;
  5. }
  6. else if (typeof define === "function" && define.amd) {
  7. define(["require", "exports"], factory);
  8. }
  9. })(function (require, exports) {
  10. "use strict";
  11. Object.defineProperty(exports, "__esModule", { value: true });
  12. /**
  13. * @name IonicPage
  14. * @description
  15. * The Ionic Page handles registering and displaying specific pages based on URLs. It's used
  16. * underneath `NavController` so it will never have to be interacted with directly. When a new
  17. * page is pushed with `NavController`, the URL is updated to match the path to this page.
  18. *
  19. * Unlike traditional web apps, URLs don't dictate navigation in Ionic apps.
  20. * Instead, URLs help us link to specific pieces of content as a breadcrumb.
  21. * The current URL gets updated as we navigate, but we use the `NavController`
  22. * push and pop, or `NavPush` and `NavPop` to move around. This makes it much easier
  23. * to handle complicated nested navigation.
  24. *
  25. * We refer to our URL system as a deep link system instead of a router to encourage
  26. * Ionic developers to think of URLs as a breadcrumb rather than as the source of
  27. * truth in navigation. This encourages flexible navigation design and happy apps all
  28. * over the world.
  29. *
  30. *
  31. * @usage
  32. *
  33. * The first step to setting up deep links is to add the page that should be
  34. * a deep link in the `IonicPageModule.forChild` import of the page's module.
  35. * For our examples, this will be `MyPage`:
  36. *
  37. * ```ts
  38. * @NgModule({
  39. * declarations: [
  40. * MyPage
  41. * ],
  42. * imports: [
  43. * IonicPageModule.forChild(MyPage)
  44. * ],
  45. * entryComponents: [
  46. * MyPage
  47. * ]
  48. * })
  49. * export class MyPageModule {}
  50. * ```
  51. *
  52. * Then, add the `@IonicPage` decorator to the component. The most simple usage is adding an
  53. * empty decorator:
  54. *
  55. * ```ts
  56. * @IonicPage()
  57. * @Component({
  58. * templateUrl: 'main.html'
  59. * })
  60. * export class MyPage {}
  61. * ```
  62. *
  63. * This will automatically create a link to the `MyPage` component using the same name as the class,
  64. * `name`: `'MyPage'`. The page can now be navigated to by using this name. For example:
  65. *
  66. * ```ts
  67. * @Component({
  68. * templateUrl: 'another-page.html'
  69. * })
  70. * export class AnotherPage {
  71. * constructor(public navCtrl: NavController) {}
  72. *
  73. * goToMyPage() {
  74. * // go to the MyPage component
  75. * this.navCtrl.push('MyPage');
  76. * }
  77. * }
  78. * ```
  79. *
  80. * The `@IonicPage` decorator accepts a `DeepLinkMetadataType` object. This object accepts
  81. * the following properties: `name`, `segment`, `defaultHistory`, and `priority`. All of them
  82. * are optional but can be used to create complex navigation links.
  83. *
  84. *
  85. * ### Changing Name
  86. *
  87. * As mentioned previously, the `name` property will be set to the class name if it isn't provided.
  88. * Changing the name of the link is extremely simple. To change the name used to link to the
  89. * component, simply pass it in the decorator like so:
  90. *
  91. * ```ts
  92. * @IonicPage({
  93. * name: 'my-page'
  94. * })
  95. * ```
  96. *
  97. * This will create a link to the `MyPage` component using the name `'my-page'`. Similar to the previous
  98. * example, the page can be navigated to by using the name:
  99. *
  100. * ```ts
  101. * goToMyPage() {
  102. * // go to the MyPage component
  103. * this.navCtrl.push('my-page');
  104. * }
  105. * ```
  106. *
  107. *
  108. * ### Setting URL Path
  109. *
  110. * The `segment` property is used to set the URL to the page. If this property isn't provided, the
  111. * `segment` will use the value of `name`. Since components can be loaded anywhere in the app, the
  112. * `segment` doesn't require a full URL path. When a page becomes the active page, the `segment` is
  113. * appended to the URL.
  114. *
  115. * The `segment` can be changed to anything and doesn't have to match the `name`. For example, passing
  116. * a value for `name` and `segment`:
  117. *
  118. * ```ts
  119. * @IonicPage({
  120. * name: 'my-page',
  121. * segment: 'some-path'
  122. * })
  123. * ```
  124. *
  125. * When navigating to this page as the first page in the app, the URL will look something like:
  126. *
  127. * ```
  128. * http://localhost:8101/#/some-path
  129. * ```
  130. *
  131. * However, navigating to the page will still use the `name` like the previous examples do.
  132. *
  133. *
  134. * ### Dynamic Links
  135. *
  136. * The `segment` property is useful for creating dynamic links. Sometimes the URL isn't known ahead
  137. * of time, so it can be passed as a variable.
  138. *
  139. * Since passing data around is common practice in an app, it can be reflected in the app's URL by
  140. * using the `:param` syntax. For example, set the `segment` in the `@IonicPage` decorator:
  141. *
  142. * ```ts
  143. * @IonicPage({
  144. * name: 'detail-page',
  145. * segment: 'detail/:id'
  146. * })
  147. * ```
  148. *
  149. * In this case, when we `push` to a new instance of `'detail-page'`, the value of `id` will
  150. * in the `detailInfo` data being passed to `push` will replace `:id` in the URL.
  151. *
  152. * Important: The property needs to be something that can be converted into a string, objects
  153. * are not supported.
  154. *
  155. * For example, to push the `'detail-page'` in the `ListPage` component, the following code could
  156. * be used:
  157. *
  158. * ```ts
  159. * @IonicPage({
  160. * name: 'list'
  161. * })
  162. * export class ListPage {
  163. * constructor(public navCtrl: NavController) {}
  164. *
  165. * pushPage(detailInfo) {
  166. * // Push an `id` to the `'detail-page'`
  167. * this.navCtrl.push('detail-page', {
  168. * 'id': detailInfo.id
  169. * })
  170. * }
  171. * }
  172. * ```
  173. *
  174. * If the value of `detailInfo.id` is `12`, for example, the URL would end up looking like this:
  175. *
  176. * ```
  177. * http://localhost:8101/#/list/detail/12
  178. * ```
  179. *
  180. * Since this `id` will be used to pull in the data of the specific detail page, it's Important
  181. * that the `id` is unique.
  182. *
  183. * Note: Even though the `name` is `detail-page`, the `segment` uses `detail/:id`, and the URL
  184. * will use the `segment`.
  185. *
  186. *
  187. * ### Default History
  188. *
  189. * Pages can be navigated to using deep links from anywhere in the app, but sometimes the app is
  190. * launched from a URL and the page needs to have the same history as if it were navigated to from
  191. * inside of the app.
  192. *
  193. * By default, the page would be navigated to as the first page in the stack with no prior history.
  194. * A good example is the App Store on iOS. Clicking on a URL to an application in the App Store will
  195. * load the details of the application with no back button, as if it were the first page ever viewed.
  196. *
  197. * The default history of any page can be set in the `defaultHistory` property. This history will only
  198. * be used if the history doesn't already exist, meaning if you navigate to the page the history will
  199. * be the pages that were navigated from.
  200. *
  201. * The `defaultHistory` property takes an array of page names. The page names are specified as statically
  202. * analyzable strings (which means you must use strings and not variables or delared constants). If the
  203. * parent page does not have a `name` specified in its `IonicPage` decorator its name is its class name.
  204. *
  205. * For example, setting the history of the detail page to the list page where the `name` is `list`:
  206. *
  207. * ```ts
  208. * @IonicPage({
  209. * name: 'detail-page',
  210. * segment: 'detail/:id',
  211. * defaultHistory: ['list']
  212. * })
  213. * ```
  214. *
  215. * In this example, if the app is launched at `http://localhost:8101/#/detail/my-detail` the displayed page
  216. * will be the `'detail-page'` with an id of `my-detail` and it will show a back button that goes back to
  217. * the `'list'` page.
  218. *
  219. * For a deeper example:
  220. *
  221. * ```ts
  222. * @IonicPage({
  223. * segment: 'contact-more-info',
  224. * defaultHistory: ['ContactDetailPage', 'Contact']
  225. * })
  226. * ...
  227. * export class ContactMoreInfoPage {
  228. * ...
  229. * }
  230. * ```
  231. *
  232. * In this example, if the app is launched at `http://localhost:8101/#/contact/contact-more-info` the displayed page
  233. * will be the `'ContactMoreInfoPage'`. It will show a back button that will go to the `'ContactDetailPage'` which
  234. * will also show a back button which will go to the `'Constact'` page.
  235. *
  236. * An example of an application with a set history stack is the Instagram application. Opening a link
  237. * to an image on Instagram will show the details for that image with a back button to the user's profile
  238. * page. There is no "right" way of setting the history for a page, it is up to the application.
  239. *
  240. * ### Priority
  241. *
  242. * The `priority` property is only used during preloading. By default, preloading is turned off so setting
  243. * this property would do nothing. Preloading eagerly loads all deep links after the application boots
  244. * instead of on demand as needed. To enable preloading, set `preloadModules` in the main application module
  245. * config to `true`:
  246. *
  247. * ```ts
  248. * @NgModule({
  249. * declarations: [
  250. * MyApp
  251. * ],
  252. * imports: [
  253. * BrowserModule,
  254. * IonicModule.forRoot(MyApp, {
  255. * preloadModules: true
  256. * })
  257. * ],
  258. * bootstrap: [IonicApp],
  259. * entryComponents: [
  260. * MyApp
  261. * ]
  262. * })
  263. * export class AppModule { }
  264. * ```
  265. *
  266. * If preloading is turned on, it will load the modules based on the value of `priority`. The following
  267. * values are possible for `priority`: `"high"`, `"low"`, and `"off"`. When there is no `priority`, it
  268. * will be set to `"low"`.
  269. *
  270. * All deep links with their priority set to `"high"` will be loaded first. Upon completion of loading the
  271. * `"high"` priority modules, all deep links with a priority of `"low"` (or no priority) will be loaded. If
  272. * the priority is set to `"off"` the link will not be preloaded. Setting the `priority` is as simple as
  273. * passing it to the `@IonicPage` decorator:
  274. *
  275. * ```ts
  276. * @IonicPage({
  277. * name: 'my-page',
  278. * priority: 'high'
  279. * })
  280. * ```
  281. *
  282. * We recommend setting the `priority` to `"high"` on the pages that will be viewed first when launching
  283. * the application.
  284. *
  285. */
  286. function IonicPage(_config) {
  287. return function (clazz) {
  288. return clazz;
  289. };
  290. }
  291. exports.IonicPage = IonicPage;
  292. });
  293. //# sourceMappingURL=ionic-page.js.map