-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bank information functionality and some bugfixing
- Loading branch information
1 parent
19fd944
commit 29e2e82
Showing
14 changed files
with
593 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
projects/ng2-iban/src/lib/ng2-iban-provider-config.interface.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import {Ng2BankInformationConfig} from './service/bank-information/ng2-bank-information.config'; | ||
|
||
export interface Ng2IbanProviderConfigInterface { | ||
bankInformationConfig: Partial<Ng2BankInformationConfig>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import {inject, TestBed} from '@angular/core/testing'; | ||
import {Ng2IbanModule} from './ng2-iban.module'; | ||
import {Ng2BankInformationService} from './service/bank-information/ng2-bank-information.service'; | ||
import {HttpClientModule} from '@angular/common/http'; | ||
import {HttpClientTestingModule, HttpTestingController} from '@angular/common/http/testing'; | ||
|
||
describe('Ng2IbanModule', () => { | ||
let module: Ng2IbanModule; | ||
let bankInformationService: Ng2BankInformationService; | ||
|
||
beforeEach(() => { | ||
TestBed.configureTestingModule({ | ||
imports: [ | ||
HttpClientModule, | ||
HttpClientTestingModule, | ||
Ng2IbanModule.forRoot( | ||
{ | ||
bankInformationConfig: { | ||
bankInformationPath: 'testPath', | ||
bankInformationNotFound: 'testNotFound' | ||
} | ||
} | ||
) | ||
] | ||
}); | ||
module = TestBed.get(Ng2IbanModule); | ||
|
||
bankInformationService = TestBed.get(Ng2BankInformationService); | ||
}); | ||
|
||
it('should create an instance', inject([HttpTestingController], | ||
(backend: HttpTestingController) => { | ||
backend.match({ | ||
url: 'testPath', | ||
method: 'GET' | ||
})[0].flush([]); | ||
|
||
expect(bankInformationService).toBeTruthy(); | ||
expect(bankInformationService['config'].bankInformationPath).toEqual('testPath'); | ||
expect(bankInformationService['config'].bankInformationNotFound).toEqual('testNotFound'); | ||
})); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,33 @@ | ||
import { NgModule } from '@angular/core'; | ||
import {ModuleWithProviders, NgModule} from '@angular/core'; | ||
import {Ng2IbanPipe} from './pipe/iban/ng2-iban.pipe'; | ||
import {Ng2IbanDirective} from './directive/iban/ng2-iban.directive'; | ||
import {Ng2BankInformationConfig} from './service/bank-information/ng2-bank-information.config'; | ||
import {Ng2IbanProviderConfigInterface} from './ng2-iban-provider-config.interface'; | ||
import {Ng2BankInformationPipe} from './pipe/bank-information/ng2-bank-information.pipe'; | ||
|
||
@NgModule({ | ||
declarations: [ | ||
Ng2IbanPipe, | ||
Ng2BankInformationPipe, | ||
Ng2IbanDirective | ||
], | ||
imports: [ | ||
], | ||
imports: [], | ||
exports: [ | ||
Ng2IbanPipe, | ||
Ng2BankInformationPipe, | ||
Ng2IbanDirective | ||
] | ||
}) | ||
export class Ng2IbanModule { } | ||
|
||
export class Ng2IbanModule { | ||
static forRoot(ng2IbanProviderConfig?: Partial<Ng2IbanProviderConfigInterface>): ModuleWithProviders { | ||
return { | ||
ngModule: Ng2IbanModule, | ||
providers: [ | ||
{ | ||
provide: Ng2BankInformationConfig, useValue: ng2IbanProviderConfig.bankInformationConfig | ||
} | ||
] | ||
}; | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
projects/ng2-iban/src/lib/pipe/bank-information/ng2-bank-information-option.interface.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export interface Ng2BankInformationOptionInterface { | ||
locale: string; | ||
property: string; | ||
} |
Oops, something went wrong.