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'; | |
@Component({ | |
selector: 'app-profile-settings', | |
templateUrl: './profile-settings.component.html', | |
styleUrls: ['./profile-settings.component.css'] | |
}) | |
export class ProfileSettingsComponent implements OnInit { |
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'; | |
@Component({ | |
selector: 'app-user-profile', | |
templateUrl: './user-profile.component.html', | |
styleUrls: ['./user-profile.component.css'] | |
}) | |
export class UserProfileComponent implements OnInit { |
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
import { Injectable } from '@angular/core'; | |
import { AngularFireDatabase, AngularFireList } from 'angularfire2/database'; | |
import { AngularFireAuth } from 'angularfire2/auth'; | |
import { Observable } from 'rxjs/Observable'; | |
import * as firebase from 'firebase/app'; | |
import { ChatMessage } from '../models/chat-message.model'; | |
@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
import { Component } from '@angular/core'; | |
import { AuthService } from '../services/auth.service'; | |
import { ChatService } from '../services/chat.service'; | |
@Component({ | |
selector: 'app-login-form', | |
templateUrl: './login-form.component.html', | |
styleUrls: ['./login-form.component.css'] | |
}) | |
export class LoginFormComponent { |
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>Login</h2> | |
<form #loginForm="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
<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> |
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
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
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(); | |
}); | |
} |