Refactor move ContactFormService into contact library

master
Kevin C. Coram 2019-09-05 22:56:08 -04:00
parent bfda0985eb
commit 57d46442c6
Signed by: kevin
GPG Key ID: 0342351B3D61AD35
6 changed files with 16 additions and 7 deletions

View File

@ -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();
}));

View File

@ -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',

View File

@ -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';

View File

@ -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 ]
}
}
}