Guest User

Untitled

a guest
Jul 20th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. import {
  2. Component,
  3. OnInit,
  4. Output,
  5. EventEmitter,
  6. Input,
  7. OnChanges, SimpleChanges, SimpleChange } from '@angular/core';
  8.  
  9. @Component( {
  10. selector: 'app-time-lapse-form',
  11. templateUrl: './time-lapse-form.component.html',
  12. styleUrls: ['./time-lapse-form.component.css']
  13. } )
  14. export class TimeLapseFormComponent implements OnInit, OnChanges {
  15.  
  16. ...
  17.  
  18.  
  19. // Animation View Data
  20. @Input() frameStartTime: string;
  21. @Input() frameEndTime: string;
  22. private _frameStartTime: string;
  23. private _frameEndTime: string;
  24.  
  25. ...
  26.  
  27. ngOnChanges( changes: SimpleChanges ) {
  28. for (let propName in changes) {
  29. let chng = changes[propName];
  30. let cur = JSON.stringify(chng.currentValue);
  31. let prev = JSON.stringify(chng.previousValue);
  32. console.log(cur);
  33. }
  34. }
  35.  
  36. ...
  37.  
  38. }
  39.  
  40. app-time-lapse-form *ngIf="currentView == 'timeLapse'"
  41. (timeLapseData)="showTimeLapse($event)"
  42. [frameStartTime]="currentFrameStart"
  43. [frameEndTime]="currentFrameEnd"
  44. app-time-lapse-form
  45.  
  46. export class MapAppComponent implements OnInit, OnDestroy {
  47. ...
  48.  
  49. currentFrameStart = null;
  50. currentFrameEnd = null;
  51.  
  52. ...
  53.  
  54. animateFrame() {
  55. // Code that changes values here
  56. }
Add Comment
Please, Sign In to add comment