Refactor move ContactFormService into contact library
parent
bfda0985eb
commit
57d46442c6
|
@ -6,7 +6,6 @@ import { NameComponent } from './name/name.component';
|
|||
import { AddressListComponent } from './address-list/address-list.component';
|
||||
import { AddressComponent } from './address/address.component';
|
||||
import { ContactModule } from '@nested-forms/contact';
|
||||
import { ContactFormService } from './services/contact-form.service';
|
||||
|
||||
describe('AppComponent', () => {
|
||||
beforeEach(async(() => {
|
||||
|
@ -14,10 +13,15 @@ describe('AppComponent', () => {
|
|||
imports: [
|
||||
RouterTestingModule,
|
||||
ReactiveFormsModule,
|
||||
ContactModule.forRoot()
|
||||
ContactModule.forRoot(),
|
||||
],
|
||||
declarations: [AppComponent, NameComponent, AddressComponent, AddressListComponent],
|
||||
providers: [ ContactFormService ],
|
||||
declarations: [
|
||||
AppComponent,
|
||||
NameComponent,
|
||||
AddressComponent,
|
||||
AddressListComponent,
|
||||
],
|
||||
providers: [],
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
import { Component, OnDestroy, OnInit } from '@angular/core';
|
||||
import { FormGroup } from '@angular/forms';
|
||||
import { Contact, ContactService } from '@nested-forms/contact';
|
||||
import {
|
||||
Contact,
|
||||
ContactService,
|
||||
ContactFormService,
|
||||
} from '@nested-forms/contact';
|
||||
import { Subscription } from 'rxjs';
|
||||
import { ContactFormService } from './services/contact-form.service';
|
||||
|
||||
@Component({
|
||||
selector: 'nested-forms-root',
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
export * from './lib/contact-model';
|
||||
export * from './lib/contact.service';
|
||||
export * from './lib/services/contact-form.service';
|
||||
export * from './lib/contact.module';
|
|
@ -1,6 +1,7 @@
|
|||
import { NgModule, Optional, SkipSelf } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { ContactService } from './contact.service';
|
||||
import { ContactFormService } from './services/contact-form.service';
|
||||
|
||||
@NgModule({
|
||||
declarations: [],
|
||||
|
@ -22,7 +23,7 @@ export class ContactModule {
|
|||
static forRoot() {
|
||||
return {
|
||||
ngModule: ContactModule,
|
||||
providers: [ ContactService ]
|
||||
providers: [ ContactService, ContactFormService ]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue