Skip to content
Snippets Groups Projects
Commit 3148fa09 authored by OZGCloud's avatar OZGCloud
Browse files

OZG-7128 provider

parent b2a0c0a6
Branches
Tags
No related merge requests found
import { StateResource, createStateResource } from '@alfa-client/tech-shared';
import { createStateResource, StateResource } from '@alfa-client/tech-shared';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { ReactiveFormsModule } from '@angular/forms';
import { singleCold, singleHot } from 'libs/tech-shared/test/marbles';
......@@ -19,13 +19,18 @@ describe('PostfachContainerComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [PostfachContainerComponent, ReactiveFormsModule, MockComponent(PostfachFormComponent)],
})
.overrideComponent(PostfachContainerComponent, {
set: {
providers: [
{
provide: PostfachService,
useValue: postfachService,
},
],
}).compileComponents();
},
})
.compileComponents();
});
beforeEach(() => {
......
import { StateResource } from '@alfa-client/tech-shared';
import { AsyncPipe } from '@angular/common';
import { CommonModule } from '@angular/common';
import { Component, OnInit } from '@angular/core';
import { Observable } from 'rxjs';
import { PostfachResource } from '../postfach.model';
......@@ -10,7 +10,8 @@ import { PostfachFormComponent } from './postfach-form/postfach-form.component';
selector: 'admin-postfach-container',
templateUrl: './postfach-container.component.html',
standalone: true,
imports: [PostfachFormComponent, AsyncPipe],
imports: [CommonModule, PostfachFormComponent],
providers: [PostfachService],
})
export class PostfachContainerComponent implements OnInit {
postfachStateResource$: Observable<StateResource<PostfachResource>>;
......
......@@ -2,11 +2,10 @@ import { SettingsService } from '@admin-client/admin-settings';
import { ResourceRepository } from '@alfa-client/tech-shared';
import { NgModule } from '@angular/core';
import { createPostfachResourceService, PostfachResourceService } from './postfach-resource.service';
import { PostfachService } from './postfach.service';
@NgModule({
providers: [
PostfachService,
SettingsService,
{
provide: PostfachResourceService,
useFactory: createPostfachResourceService,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment