diff --git a/.vs/VSWorkspaceState.json b/.vs/VSWorkspaceState.json index 5f315c0..ce3696d 100644 --- a/.vs/VSWorkspaceState.json +++ b/.vs/VSWorkspaceState.json @@ -3,7 +3,8 @@ "", "\\src", "\\src\\app", - "\\src\\app\\boards" + "\\src\\app\\boards", + "\\src\\app\\boards\\send-post" ], "SelectedNode": "\\src\\app\\boards\\boards.component.html", "PreviewInSolutionExplorer": false diff --git a/.vs/slnx.sqlite b/.vs/slnx.sqlite index 1f7b281..caae45e 100644 Binary files a/.vs/slnx.sqlite and b/.vs/slnx.sqlite differ diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 1fed61c..28d3149 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -10,6 +10,7 @@ import { BoardsComponent } from './boards/boards.component'; import { NotFoundComponent } from './not-found/not-found.component'; import { ApiChatService } from './api-chat.service'; import { FormsModule } from '@angular/forms'; +import { SendPostComponent } from './boards/send-post/send-post.component'; const appRoutes: Routes = [ { path: '', component: HomeComponent }, @@ -24,7 +25,8 @@ const appRoutes: Routes = [ HomeComponent, AboutComponent, BoardsComponent, - NotFoundComponent + NotFoundComponent, + SendPostComponent ], imports: [ BrowserModule, diff --git a/src/app/boards/boards.component.html b/src/app/boards/boards.component.html index ee0bfd3..7d7092c 100644 --- a/src/app/boards/boards.component.html +++ b/src/app/boards/boards.component.html @@ -1,5 +1,6 @@ свiня -

Борды работают, это в хтмл!

+ , +
@@ -17,4 +18,4 @@
-
\ No newline at end of file + diff --git a/src/app/boards/send-post/send-post.component.css b/src/app/boards/send-post/send-post.component.css new file mode 100644 index 0000000..e69de29 diff --git a/src/app/boards/send-post/send-post.component.html b/src/app/boards/send-post/send-post.component.html new file mode 100644 index 0000000..ec472af --- /dev/null +++ b/src/app/boards/send-post/send-post.component.html @@ -0,0 +1,5 @@ +

+ +

+ +

diff --git a/src/app/boards/send-post/send-post.component.spec.ts b/src/app/boards/send-post/send-post.component.spec.ts new file mode 100644 index 0000000..5849c6e --- /dev/null +++ b/src/app/boards/send-post/send-post.component.spec.ts @@ -0,0 +1,23 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { SendPostComponent } from './send-post.component'; + +describe('SendPostComponent', () => { + let component: SendPostComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ SendPostComponent ] + }) + .compileComponents(); + + fixture = TestBed.createComponent(SendPostComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/boards/send-post/send-post.component.ts b/src/app/boards/send-post/send-post.component.ts new file mode 100644 index 0000000..ced3de1 --- /dev/null +++ b/src/app/boards/send-post/send-post.component.ts @@ -0,0 +1,34 @@ +import { Component, OnInit } from '@angular/core'; +import { HttpClient } from '@angular/common/http'; + +@Component({ + selector: 'app-send-post', + templateUrl: './send-post.component.html', + styleUrls: ['./send-post.component.css'] +}) +export class SendPostComponent implements OnInit { + + constructor(private http: HttpClient) { + console.log("Открыто окно постинга"); + } + + sendPost(text: string) { + console.log("Отправляю пост..."); + var postToSend = + { + Date: Date, + Id: 0, + Text: text + } + + + this.http.post('http://api.vdk2ch.ru:5000/PostTo', postToSend).subscribe(); + + + } + + + ngOnInit(): void { + } + +}