Skip to content

Instantly share code, notes, and snippets.

View clintonyeb's full-sized avatar
🏠
Working from home

Clinton Yeboah clintonyeb

🏠
Working from home
View GitHub Profile
import { Search } from './../models/Search';
import { Component, OnInit, Output, EventEmitter, Input } from '@angular/core';
@Component({
selector: 'app-search',
templateUrl: './search.component.html',
styleUrls: ['./search.component.scss'],
})
export class SearchComponent implements OnInit {
@Output() search = new EventEmitter<Search>();
<input
type="search"
className="search-field"
placeholder="Search..."
(keyup)="onInputChanged($event)"
/>
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Observable } from 'rxjs';
@Injectable({
providedIn: 'root',
})
export class AppService {
constructor(private http: HttpClient) {}
import { Component, Input, OnInit } from '@angular/core';
import { Record } from './models/Record';
import { AppService } from './app.service';
import { Observable } from 'rxjs';
import { Search } from './models/Search';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss'],
<div className="App">
<table>
<thead
app-header
(search)="searchRecords($event)"
(sort)="sortRecords()"
></thead>
<tbody
app-record
*ngIf="records"
h1 {
font-size: 30px;
color: #fff;
text-transform: uppercase;
font-weight: 300;
text-align: center;
margin-bottom: 15px;
}
table {
<div class="container mx-auto w-screen px-4">
<div class="w-full max-w-2xl">
<h1 class="text-center text-indigo-600 text-lg font-bold">
Moving Average
</h1>
<div class="flex flex-row bg-grey shadow-md rounded px-8 pt-6 pb-8 mb-4">
<form class="px-2 pt-6 pb-8 mb-4" (ngSubmit)="handleSubmit()" #heroForm="ngForm">
<div class="w-full mb-4">
<label class="block uppercase tracking-wide text-gray-700 text-xs font-bold mb-2">
Select Currency:
<div class="px-2 pt-6 pb-8 mb-4">
<div>
<span class="text-center text-gray-600 text-lg font-bold m-2">
Moving Average:
</span>
{{movavg ? movavg : "Please wait..."}}
</div>
<div>
<span class="text-center text-gray-600 text-lg font-bold m-2">
Ticker:
import { Component, OnInit } from '@angular/core';
import { AppService } from './app.service';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss'],
})
export class AppComponent implements OnInit {
currency = '';
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
@Injectable({
providedIn: 'root'
})
export class AppService {
constructor(private http: HttpClient) { }