-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
11b429a
commit 92e19c0
Showing
13 changed files
with
192 additions
and
48 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
<app-top-bar></app-top-bar> | ||
<app-top-bar ></app-top-bar> | ||
|
||
<router-outlet></router-outlet> | ||
<router-outlet ></router-outlet> |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,29 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
import { Component, OnInit, Input } from '@angular/core'; | ||
import { LoginService } from '../services/login.service'; | ||
import {Router} from '@angular/router'; | ||
|
||
@Component({ | ||
selector: 'app-dashboard', | ||
templateUrl: './dashboard.component.html', | ||
styleUrls: ['./dashboard.component.css'] | ||
}) | ||
export class DashboardComponent implements OnInit { | ||
|
||
constructor() { } | ||
|
||
constructor(private loginService: LoginService, private router: Router) { | ||
loginService.authenticate(); | ||
} | ||
ngOnInit() { | ||
// this.loadScript('https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.2.0/socket.io.js'); | ||
// this.loadScript('https://code.jquery.com/jquery-1.11.1.js'); | ||
// this.loadScript('../assets/socket.io/socket.io-client.js'); | ||
} | ||
public loadScript(url: string) { | ||
const body = document.body as HTMLDivElement; | ||
const script = document.createElement('script'); | ||
script.innerHTML = ''; | ||
script.src = url; | ||
script.async = false; | ||
script.defer = true; | ||
body.appendChild(script); | ||
} | ||
|
||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
<mat-toolbar color="primary"> | ||
<mat-toolbar-row> | ||
<span><a mat-button><h3>Home</h3></a></span> | ||
<span><a mat-button routerLink="/dashboard"><h3>Home</h3></a></span> | ||
<span class="spacer"></span> | ||
<a mat-button routerLink="/login">Login</a> | ||
<a mat-button *ngIf="1" (click)="logout()">Logout</a> | ||
</mat-toolbar-row> | ||
</mat-toolbar> |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
var socket = io(); | ||
|
||
// on connection to server, ask for user's name with an anonymous callback | ||
socket.on('connect', function(){ | ||
// call the server-side function 'adduser' and send one parameter (value of prompt) | ||
alert(); | ||
socket.emit('adduser', prompt("What's your name?")); | ||
}); |
This file contains 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