Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. console.log(component.records);//prints empty array[ ]
  2. console.log(mockReturns['data']['Records']);//prints entire array
  3.  
  4. //Intialization
  5. let mockReturns={
  6. data:
  7.  
  8. {
  9. Customer:{
  10. "CustomerName": "Stress_Test",
  11. },
  12. Products:[],
  13. Records:
  14. [
  15. {
  16. "ActivationId": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
  17. "ActivationState": "Deployed",
  18. "Address": "",
  19. "AllowPortalLogin": "Yes",
  20. },
  21. ....
  22. ]
  23. }//close data
  24. }//overall object
  25.  
  26. component.records=mockReturns['data']['Records'];
  27. component.headers=mockheaders;
  28. fixture.detectChanges();
  29. let spyOnProductsTable=spyOn(component,'getData').and.callThrough();
  30. component.getData();
  31. fixture.detectChanges();
  32.  
  33.  
  34.  
  35.  
  36. component.ts
  37.  
  38. this.records = res['data']['Records'] as Array<any>;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement