Updated news functionality
This commit is contained in:
@@ -1,6 +0,0 @@
|
||||
<ng-container *ngIf="newsData$ | async as news">
|
||||
<h1>{{news.title}}</h1>
|
||||
<hr />
|
||||
<div [innerHtml]="news.body"></div>
|
||||
</ng-container>
|
||||
<ui-loader *ngIf="newsLoading$ | async" uiType="padded"></ui-loader>
|
||||
@@ -1,5 +0,0 @@
|
||||
@import 'variables/gutters';
|
||||
|
||||
h1 {
|
||||
margin-top: $digi--layout--gutter--xl;
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { NewsComponent } from './news.component';
|
||||
describe('NewsComponent', () => {
|
||||
let component: NewsComponent;
|
||||
let fixture: ComponentFixture<NewsComponent>;
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
||||
declarations: [NewsComponent]
|
||||
})
|
||||
.compileComponents();
|
||||
});
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(NewsComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -1,17 +0,0 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { News } from '@msfa-models/news.model';
|
||||
import { NewsApiService } from '@msfa-services/api/news.api.service';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
@Component({
|
||||
selector: 'msfa-news',
|
||||
templateUrl: 'news.component.html',
|
||||
styleUrls: ['news.component.scss']
|
||||
})
|
||||
export class NewsComponent {
|
||||
newsData$: Observable<News> = this.newsApiService.fetchNews$();
|
||||
newsLoading$: Observable<boolean> = this.newsApiService.newsLoading$;
|
||||
|
||||
constructor(private newsApiService: NewsApiService) { }
|
||||
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
|
||||
import { UiLoaderModule } from '@ui/loader/loader.module';
|
||||
import { NewsComponent } from './news.component';
|
||||
|
||||
@NgModule({
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
||||
declarations: [NewsComponent],
|
||||
imports: [CommonModule, UiLoaderModule],
|
||||
exports: [NewsComponent]
|
||||
})
|
||||
export class NewsModule {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user