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
import { Component, OnInit } from '@angular/core'; | |
import { DatePipe } from '@angular/common'; | |
import { FormBuilder, FormGroup } from '@angular/forms'; | |
import {Todo} from './to-do'; | |
import { TodoService } from './to-do.service'; | |
export enum SaveMode { | |
None, | |
New, |
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
<div class="container"> | |
<div class="col-md-12"> | |
<h1>My To-Dos</h1> | |
<table class="table table-bordered table-striped table-hover"> | |
<thead> | |
<tr> | |
<th class="text-center">To-Do</th> | |
<th class="text-center">Due</th> | |
<th class="text-center">Notes</th> | |
<th class="text-center">Done</th> |
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
import { Injectable } from '@angular/core'; | |
import { Todo } from './to-do'; | |
import { TODO_ITEMS } from '../../api/to-do-data'; | |
@Injectable() | |
export class TodoService { | |
pItems: Todo[] = TODO_ITEMS; | |
constructor() { } |
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
export interface Todo { | |
id: number; | |
name: string; | |
notes: string; | |
due: Date; | |
done: Boolean; | |
} | |
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
import {Todo} from '../app/to-do/to-do'; | |
export const TODO_ITEMS: Todo[] = [ | |
{ | |
id: 1, | |
name: 'Lunch with Lily', | |
notes: 'sea food', | |
due: new Date(new Date().setDate(new Date().getDate() + 4)), | |
done: false | |
}, { |
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
//zones can be entirely bypassed by bootstrapping the app with 'noop' | |
platformBrowserDynamic() | |
.bootstrapModule(AppModule, {ngZone: 'noop'}) | |
.then( ref => {} ); |
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
<app-to-do></app-to-do> |
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
#==================== Building Stage ================================================ | |
# Create the image based on the official Node 8.9.0 image from Dockerhub | |
FROM node:8.9.0 as node | |
# Create a directory where our app will be placed. This might not be necessary | |
RUN mkdir -p /to-do-app | |
# Change directory so that our commands run inside this new directory | |
WORKDIR /to-do-app |
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
#excluding the node_modules directory and the .git directory | |
node_modules/ | |
.git/ |
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
server { | |
listen 80; | |
location / { | |
root /usr/share/nginx/html; | |
index index.html index.htm; | |
try_files $uri $uri/ /index.html =404; | |
} | |
} |
OlderNewer