This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Routes } from '@angular/router'; | |
import { SignupFormComponent } from './app/signup-form/signup-form.component'; | |
import { LoginFormComponent } from './app/login-form/login-form.component'; | |
import { ChatroomComponent } from './app/chatroom/chatroom.component'; | |
import { ProfileSettingsComponent } from './app/profile-settings/profile-settings.component'; | |
export const appRoutes: Routes = [ | |
{ path: 'signup', component: SignupFormComponent }, | |
{ path: 'login', component: LoginFormComponent }, | |
{ path: 'chat', component: ChatroomComponent }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { BrowserModule } from '@angular/platform-browser'; | |
import { NgModule } from '@angular/core'; | |
import { FormsModule } from '@angular/forms'; | |
import { RouterModule } from '@angular/router'; | |
import { AngularFireModule } from 'angularfire2'; | |
import { AngularFireDatabaseModule } from 'angularfire2/database'; | |
import { AngularFireAuthModule } from 'angularfire2/auth'; | |
import { AngularFontAwesomeModule } from 'angular-font-awesome'; | |
import {NgbModule} from '@ng-bootstrap/ng-bootstrap'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div> | |
<div> | |
<app-navbar></app-navbar> | |
</div> | |
<router-outlet></router-outlet> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="form"> | |
<h2>Sign Up</h2> | |
<form #signupForm="ngForm"> | |
<div class="form-group"> | |
<label>Email : </label> | |
<br> | |
<input | |
type="email" name="userEmail" | |
#userEmail="ngModel" | |
placeholder="Enter your email address" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component, OnInit } from '@angular/core'; | |
import { AuthService } from '../services/auth.service'; | |
import { Router } from '@angular/router'; | |
@Component({ | |
selector: 'app-signup-form', | |
templateUrl: './signup-form.component.html', | |
styleUrls: ['./signup-form.component.css'] | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
signup(email: string, userName: string, password: string) { | |
return this.afAuth.auth.createUserWithEmailAndPassword(email, password) | |
.then((user) => { | |
this.signupAttempt = 1; | |
this.authState = user; | |
const status = 'online'; | |
this.setUserData(email, userName, status); | |
window.location.reload(); | |
}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Injectable } from '@angular/core'; | |
import { Router } from '@angular/router'; | |
import { AngularFireAuth } from 'angularfire2/auth'; | |
import { AngularFireDatabase } from 'angularfire2/database'; | |
import * as firebase from 'firebase/app'; | |
import { Observable } from 'rxjs/Observable'; | |
@Injectable({ | |
providedIn: 'root' | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class User { | |
uid: string; | |
userName: string; | |
email: string; | |
profilePhoto?: string; | |
password: string; | |
status: string; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="container"> | |
<div class="userProfile"> | |
<app-user-profile></app-user-profile> | |
</div> | |
<div class="feed"> | |
<app-feed></app-feed> | |
</div> | |
<div class="userList"> | |
<app-user-list></app-user-list> | |
</div> |
OlderNewer