File size: 852 Bytes
1ce2a0d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/** Angular Imports */
import { Injectable } from '@angular/core';
import { Resolve } from '@angular/router';

/** rxjs Imports */
import { Observable } from 'rxjs';

/** Custom Services */
import { AccountingService } from '../accounting.service';

/**
 * Accounting rules template data resolver.
 */
@Injectable()
export class AccountingRulesTemplateResolver implements Resolve<Object> {

  /**
   * @param {AccountingService} accountingService Accounting service.
   */
  constructor(private accountingService: AccountingService) {}

  /**
   * Returns the accounting rules template data.
   * @returns {Observable<any>}
   */
  resolve(): Observable<any> {
    // Calls the getAccountingRulesTemplate method of the AccountingService to fetch the accounting rules template data.
    return this.accountingService.getAccountingRulesTemplate();
  }

}