Skip to content

Instantly share code, notes, and snippets.

@kmhoran
kmhoran / App.tsx
Created March 20, 2020 23:24
signal_client_App.tsx
import React from "react";
import Chat from "./Chat/Chat";
import "./App.css";
function App() {
return (
<div className="App">
<Chat />
</div>
{% load static %}
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Dictionary</title>
<base href="/">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="icon" type="image/x-icon" href="{% static 'dictionary/favicon.ico' %}">
<link href="{% static 'dictionary/styles.css' %}" rel="stylesheet"/>
@import url('https://fonts.googleapis.com/css?family=Ubuntu:300i');
.definition-container{
display: inline-block;
max-width: 20em;
border: 1px solid #777;
background-color: #f5f5f5;
border-radius: 5px;
padding: 0.5em 1em;
margin: 0.2em;
}
<div class="definition-container">
<div class="part-of-speech">
{{partOfSpeech}}
</div>
<div class="actual-definition">
{{actualDefinition}}
</div>
</div>
import { Component, OnInit, Input } from '@angular/core';
@Component({
selector: 'app-word-definition',
templateUrl: './word-definition.component.html',
styleUrls: ['./word-definition.component.css']
})
export class WordDefinitionComponent implements OnInit {
@Input() partOfSpeech: string;
@Input() actualDefinition: string;
<h1>
{{word?.name}}
</h1>
<form class="form-inline my-2 my-lg-0"
#definitionForm="ngForm"
(ngSubmit)="addDefinition()">
<select class="form-control mr-sm-2"
[(ngModel)]="definitionPartOfSpeech"
required
<h1>Word List</h1>
<hr/>
<form class="form-inline my-2 my-lg-0"
#wordForm="ngForm"
(ngSubmit)="addWord()">
<input class="form-control mr-sm-2"
type="text"
placeholder="Add a word"
[(ngModel)]="wordToAdd"
name="wordToAdd"
import { Component, OnInit, NgZone } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { WordHttpService } from '../shared/word-http.service';
import { IWord, IDefinition } from '../shared/iword';
@Component({
selector: 'app-word',
templateUrl: './word.component.html',
import { Component, OnInit, NgZone } from '@angular/core';
import { Router } from '@angular/router';
import { WordHttpService } from '../shared/word-http.service';
import { IWord } from '../shared/iword';
@Component({
selector: 'app-home',
templateUrl: './home.component.html',
styleUrls: ['./home.component.css']
import { Injectable } from '@angular/core';
// Http client and associated imports
import { HttpClient, HttpHeaders, HttpErrorResponse } from '@angular/common/http';
import { Observable , throwError } from 'rxjs';
import { HttpResponse } from 'selenium-webdriver/http';
import { catchError } from 'rxjs/operators';
// Imports we've defined
import { environment } from '../../environments/environment';