a zip code crypto-currency system good for red ONLY

nav-params.js 1.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /**
  2. * @name NavParams
  3. * @description
  4. * NavParams are an object that exists on a page and can contain data for that particular view.
  5. * Similar to how data was pass to a view in V1 with `$stateParams`, NavParams offer a much more flexible
  6. * option with a simple `get` method.
  7. *
  8. * @usage
  9. * ```ts
  10. * import { NavParams } from 'ionic-angular';
  11. *
  12. * export class MyClass{
  13. *
  14. * constructor(navParams: NavParams){
  15. * // userParams is an object we have in our nav-parameters
  16. * navParams.get('userParams');
  17. * }
  18. *
  19. * }
  20. * ```
  21. * @demo /docs/demos/src/nav-params/
  22. * @see {@link /docs/components#navigation Navigation Component Docs}
  23. * @see {@link ../NavController/ NavController API Docs}
  24. * @see {@link /docs/api/components/nav/Nav/ Nav API Docs}
  25. * @see {@link /docs/api/components/nav/NavPush/ NavPush API Docs}
  26. */
  27. export class NavParams {
  28. /**
  29. * @hidden
  30. * @param {TODO} data TODO
  31. */
  32. constructor(data = {}) {
  33. this.data = data;
  34. }
  35. /**
  36. * Get the value of a nav-parameter for the current view
  37. *
  38. * ```ts
  39. * import { NavParams } from 'ionic-angular';
  40. *
  41. * export class MyClass{
  42. * constructor(public navParams: NavParams){
  43. * // userParams is an object we have in our nav-parameters
  44. * this.navParams.get('userParams');
  45. * }
  46. * }
  47. * ```
  48. *
  49. *
  50. * @param {string} param Which param you want to look up
  51. */
  52. get(param) {
  53. return this.data[param];
  54. }
  55. }
  56. //# sourceMappingURL=nav-params.js.map