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
const myString = 'My Non Empty String'; | |
const myObject = { | |
prop: 'A prop', | |
prop2: 0 | |
} | |
if (!undefined && myString && myObject.prop && !myObject.prop2) { | |
console.log('This expression is truthy!!'); | |
} |
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
const nonBooleanVariable = 'A String'; | |
if (nonBooleanVariable) { | |
console.log('A non-empty string is truthy.'); | |
} |
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 { NgModule } from '@angular/core'; | |
import { BrowserModule } from '@angular/platform-browser'; | |
import { AppComponent } from './app.component'; | |
import { FormsModule } from '@angular/forms'; | |
import { TodoService } from './todo.service'; | |
import { HttpClientModule } from '@angular/common/http'; | |
@NgModule({ | |
declarations: [AppComponent], |
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
* { | |
box-sizing: border-box; | |
padding: 0; | |
margin: 0; | |
outline: none; | |
font-family: 'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif; | |
} |
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
.todo { | |
&__header { | |
position: fixed; | |
top: 0; | |
left: 0; | |
right: 0; | |
height: 160px; | |
display: flex; | |
align-items: center; | |
padding-left: 16px; |
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="todo"> | |
<header class="todo__header"> | |
<h1>Fantastic TODO</h1> | |
</header> | |
<div class="todo__content"> | |
<ul class="todo__list"> | |
<li | |
*ngFor="let todo of todos" | |
class="todo__item"> | |
<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
import { Component, OnInit } from '@angular/core'; | |
import { Todo } from './todo.interface'; | |
import { TodoService } from './todo.service'; | |
@Component({ | |
selector: 'groundwork-root', | |
templateUrl: './app.component.html', | |
styleUrls: ['./app.component.scss'], | |
}) | |
export class AppComponent 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
export interface Todo { | |
id?: string; | |
title: string; | |
description: 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 { HttpClient } from '@angular/common/http'; | |
import { Observable } from "rxjs"; | |
import { Todo } from "./todo.interface"; | |
@Injectable({ providedIn: 'root' }) | |
export class TodoService { | |
private readonly baseUrl: string = 'http://localhost:3333/api'; | |
constructor(private http: HttpClient) {} |
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 * as express from 'express'; | |
import * as bodyParser from 'body-parser'; | |
import * as cors from 'cors'; | |
import { DBHelper } from './app/helper/db.helper'; | |
import { TodoService } from './app/todo/todo.service'; | |
const app = express(); | |
app.use(cors()) |
NewerOlder