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