a zip code crypto-currency system good for red ONLY

transition-controller.js 1.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. import { Injectable } from '@angular/core';
  2. import { Config } from '../config/config';
  3. import { isPresent } from '../util/util';
  4. import { Platform } from '../platform/platform';
  5. /**
  6. * @hidden
  7. */
  8. export class TransitionController {
  9. constructor(plt, _config) {
  10. this.plt = plt;
  11. this._config = _config;
  12. this._ids = 0;
  13. this._trns = {};
  14. }
  15. getRootTrnsId(nav) {
  16. nav = nav.parent;
  17. while (nav) {
  18. if (isPresent(nav._trnsId)) {
  19. return nav._trnsId;
  20. }
  21. nav = nav.parent;
  22. }
  23. return null;
  24. }
  25. nextId() {
  26. return this._ids++;
  27. }
  28. get(trnsId, enteringView, leavingView, opts) {
  29. let TransitionClass = this._config.getTransition(opts.animation);
  30. if (!TransitionClass) {
  31. // didn't find a transition animation, default to ios-transition
  32. TransitionClass = this._config.getTransition('ios-transition');
  33. }
  34. const trns = new TransitionClass(this.plt, enteringView, leavingView, opts);
  35. trns.trnsId = trnsId;
  36. if (!this._trns[trnsId]) {
  37. // we haven't created the root transition yet
  38. this._trns[trnsId] = trns;
  39. }
  40. else {
  41. // we already have a root transition created
  42. // add this new transition as a child to the root
  43. this._trns[trnsId].add(trns);
  44. }
  45. return trns;
  46. }
  47. destroy(trnsId) {
  48. const trans = this._trns[trnsId];
  49. if (trans) {
  50. trans.destroy();
  51. delete this._trns[trnsId];
  52. }
  53. }
  54. }
  55. TransitionController.decorators = [
  56. { type: Injectable },
  57. ];
  58. /** @nocollapse */
  59. TransitionController.ctorParameters = () => [
  60. { type: Platform, },
  61. { type: Config, },
  62. ];
  63. //# sourceMappingURL=transition-controller.js.map