Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
202 changes: 200 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,13 @@
},
"dependencies": {
"express": "^4.17.1",
"mongoose": "^6.0.7",
"socket.io": "^4.1.2"
},
"devDependencies": {
"@babel/preset-typescript": "^7.14.5",
"@types/express": "^4.17.12",
"@types/mongoose": "^5.11.97",
"@types/node": "^15.12.2",
"@types/socket.io-client": "^3.0.0",
"@typescript-eslint/eslint-plugin": "^4.26.1",
Expand Down
7 changes: 6 additions & 1 deletion src/client/src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import { AddPostComponent } from './components/add-post/add-post.component';
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { AddUserComponent } from './components/add-user/add-user.component';

const routes: Routes = [];
const routes: Routes = [
{path: "create-post", component:AddPostComponent },
{path: "create-user", component:AddUserComponent },
];

@NgModule({
imports: [RouterModule.forRoot(routes)],
Expand Down
3 changes: 2 additions & 1 deletion src/client/src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
{{title}}
<app-navigation></app-navigation>
<router-outlet></router-outlet>
10 changes: 9 additions & 1 deletion src/client/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,23 @@ import { BrowserModule } from '@angular/platform-browser';
import { HttpClientModule } from '@angular/common/http';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { AddUserComponent } from './components/add-user/add-user.component';
import { FormsModule } from '@angular/forms';
import { AddPostComponent } from './components/add-post/add-post.component';
import { NavigationComponent } from './components/navigation/navigation.component';

@NgModule({
declarations: [
AppComponent
AppComponent,
AddUserComponent,
AddPostComponent,
NavigationComponent
],
imports: [
BrowserModule,
AppRoutingModule,
HttpClientModule,
FormsModule,
],
providers: [],
bootstrap: [AppComponent]
Expand Down
16 changes: 16 additions & 0 deletions src/client/src/app/components/add-post/add-post.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<h3>Posts</h3>

<p>Title:</p>
<input type="text" [(ngModel)]="title" placeholder="Enter a title">
<br>
<p>Subject:</p>
<textarea [(ngModel)]="body" placeholder="Enter text here" cols="30" rows="10"></textarea>
<br>
<button (click)=addPost()>Add Post</button>

<div>
<ul>
<!-- <li *ngFor="let post of posts$ | async"></li> -->
</ul>
</div>

Empty file.
Loading