Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- console.log(component.records);//prints empty array[ ]
- console.log(mockReturns['data']['Records']);//prints entire array
- //Intialization
- let mockReturns={
- data:
- {
- Customer:{
- "CustomerName": "Stress_Test",
- },
- Products:[],
- Records:
- [
- {
- "ActivationId": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
- "ActivationState": "Deployed",
- "Address": "",
- "AllowPortalLogin": "Yes",
- },
- ....
- ]
- }//close data
- }//overall object
- component.records=mockReturns['data']['Records'];
- component.headers=mockheaders;
- fixture.detectChanges();
- let spyOnProductsTable=spyOn(component,'getData').and.callThrough();
- component.getData();
- fixture.detectChanges();
- component.ts
- this.records = res['data']['Records'] as Array<any>;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement