Initial commit for the Angular part. We are nowhere yet.

This commit is contained in:
Amritanshu
2019-06-14 00:32:34 +05:30
parent 1a1fa7881d
commit d59c60e81d
123 changed files with 3748 additions and 374 deletions

View File

@ -0,0 +1,25 @@
import {Component, OnInit} from '@angular/core';
import {Subject} from "rxjs";
import {AuthService} from "../auth/auth.service";
@Component({
selector: 'app-home',
templateUrl: './home.component.html',
styleUrls: ['./home.component.css']
})
export class HomeComponent implements OnInit {
public nameObject = new Subject<string>();
constructor(private auth: AuthService) {
}
ngOnInit() {
this.auth.userObservable.subscribe((user) => {
if (user.isAuthenticated) {
this.nameObject.next(user.name);
} else {
this.nameObject.next(null);
}
});
}
}