-
{{article.title}}
-
{{article.body}}
+
-
-
-{{tags | json}}
diff --git a/src/app/articles/articles.component.ts b/src/app/articles/articles.component.ts
index 434bf47..a8499eb 100644
--- a/src/app/articles/articles.component.ts
+++ b/src/app/articles/articles.component.ts
@@ -13,12 +13,12 @@ export class ArticlesComponent implements OnInit {
constructor(private service: ArticlesService) { }
ngOnInit(): void {
-
- }
- loadArticles() {
- this.service.getArticles().subscribe(response => this.articles = response.articles);
+ this.service.login();
}
+
loadTags() {
this.service.getTags().subscribe(response => this.tags = response.tags);
}
+
+
}
diff --git a/src/app/tag/tag.component.html b/src/app/tag/tag.component.html
new file mode 100644
index 0000000..18ce09d
--- /dev/null
+++ b/src/app/tag/tag.component.html
@@ -0,0 +1,6 @@
+
{{tag}}
+
+
+
diff --git a/src/app/tag/tag.component.scss b/src/app/tag/tag.component.scss
new file mode 100644
index 0000000..e69de29
diff --git a/src/app/tag/tag.component.spec.ts b/src/app/tag/tag.component.spec.ts
new file mode 100644
index 0000000..b70f018
--- /dev/null
+++ b/src/app/tag/tag.component.spec.ts
@@ -0,0 +1,25 @@
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { TagComponent } from './tag.component';
+
+describe('TagComponent', () => {
+ let component: TagComponent;
+ let fixture: ComponentFixture
;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ TagComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(TagComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/src/app/tag/tag.component.ts b/src/app/tag/tag.component.ts
new file mode 100644
index 0000000..7581059
--- /dev/null
+++ b/src/app/tag/tag.component.ts
@@ -0,0 +1,23 @@
+import { Component, OnInit, Input } from '@angular/core';
+import { ArticlesService } from '../articles.service';
+
+@Component({
+ selector: 'app-tag',
+ templateUrl: './tag.component.html',
+ styleUrls: ['./tag.component.scss']
+})
+export class TagComponent implements OnInit {
+
+ articles:any;
+ @Input() tag:any;
+
+ constructor(private service:ArticlesService) { }
+
+ ngOnInit(): void {
+ }
+
+ loadArticles() {
+ this.service.getArticles(this.tag).subscribe(response => this.articles = response.articles);
+ }
+
+}