1- import { Injectable } from " @angular/core" ;
2- import { Observable } from " rxjs" ;
3- import { PagedData } from " ./model/paged-data" ;
4- import { CorporateEmployee } from " ./model/corporate-employee" ;
5- import { Page } from " ./model/page" ;
1+ import { Injectable } from ' @angular/core' ;
2+ import { Observable } from ' rxjs' ;
3+ import { PagedData } from ' ./model/paged-data' ;
4+ import { CorporateEmployee } from ' ./model/corporate-employee' ;
5+ import { Page } from ' ./model/page' ;
66const companyData = require ( '../../assets/data/company.json' ) ;
77
88/**
@@ -26,14 +26,14 @@ export class MockServerResultsService {
2626 * @returns {PagedData<CorporateEmployee> } An array of the selected data and page
2727 */
2828 private getPagedData ( page : Page ) : PagedData < CorporateEmployee > {
29- let pagedData = new PagedData < CorporateEmployee > ( ) ;
29+ const pagedData = new PagedData < CorporateEmployee > ( ) ;
3030 page . totalElements = companyData . length ;
3131 page . totalPages = page . totalElements / page . size ;
32- let start = page . pageNumber * page . size ;
33- let end = Math . min ( ( start + page . size ) , page . totalElements ) ;
32+ const start = page . pageNumber * page . size ;
33+ const end = Math . min ( ( start + page . size ) , page . totalElements ) ;
3434 for ( let i = start ; i < end ; i ++ ) {
35- let jsonObj = companyData [ i ] ;
36- let employee = new CorporateEmployee ( jsonObj . name , jsonObj . gender , jsonObj . company , jsonObj . age ) ;
35+ const jsonObj = companyData [ i ] ;
36+ const employee = new CorporateEmployee ( jsonObj . name , jsonObj . gender , jsonObj . company , jsonObj . age ) ;
3737 pagedData . data . push ( employee ) ;
3838 }
3939 pagedData . page = page ;
0 commit comments