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 { Observable, of, throwError } from 'rxjs'; | |
import { HttpClient, HttpHeaders, HttpErrorResponse } from '@angular/common/http'; | |
import { catchError, tap, map } from 'rxjs/operators'; | |
const httpOptions = { | |
headers: new HttpHeaders({'Content-Type': 'application/json'}) | |
}; |
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 } from '@angular/core'; | |
import { LoadingController, NavController } from '@ionic/angular'; | |
import { RestService } from '../rest.service'; | |
@Component({ | |
selector: 'app-home', | |
templateUrl: 'home.page.html', | |
styleUrls: ['home.page.scss'], | |
}) |
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 { LoadingController } from '@ionic/angular'; | |
import { RestService } from '../rest.service'; | |
import { ActivatedRoute, ParamMap } from '@angular/router'; | |
@Component({ | |
selector: 'app-view', | |
templateUrl: './view.page.html', | |
styleUrls: ['./view.page.scss'], | |
}) |
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 { NavController, LoadingController } from '@ionic/angular'; | |
import { Validators, FormBuilder, FormGroup } from '@angular/forms'; | |
import { RestService } from '../rest.service'; | |
import { ActivatedRoute, Router } from '@angular/router'; | |
@Component({ | |
selector: 'app-add', | |
templateUrl: './add.page.html', | |
styleUrls: ['./add.page.scss'], |
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
<ion-content padding> | |
<form [formGroup]="todo"> | |
<ion-item> | |
<ion-label>Todo</ion-label> | |
</ion-item> | |
<ion-item> | |
<ion-input type="text" formControlName="title"></ion-input> | |
</ion-item> | |
<ion-item> | |
<ion-label>Description</ion-label> |
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
function getAllTodos(req, res) { | |
const Todo = require('../../todo/models'); | |
Todo.find({}, function(err, todos) { | |
if (err) throw err; | |
res.json(todos); | |
}); |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title> All Todos </title> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"> | |
</head> | |
<body> | |
<nav class="navbar navbar-inverse navbar-fixed-top"> | |
<div class="container"> | |
<div class="navbar-header"> |
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
<ion-list> | |
<ion-item-sliding #item> | |
<ion-item> | |
Laundry | |
</ion-item> | |
<ion-item-options side="start"> | |
<button ion-button color="light">Done</button> | |
</ion-item-options> | |
<ion-item-options side="end"> | |
<button ion-button color="light">Edit</button> |
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 { Observable, of, throwError } from 'rxjs'; | |
import { HttpClient, HttpHeaders, HttpErrorResponse } from '@angular/common/http'; | |
import { catchError, tap, map } from 'rxjs/operators'; | |
const httpOptions = { | |
headers: new HttpHeaders({'Content-Type': 'application/json'}) | |
}; |
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 } from '@angular/core'; | |
import { LoadingController, NavController } from '@ionic/angular'; | |
import { RestService } from '../rest.service'; | |
@Component({ | |
selector: 'app-home', | |
templateUrl: 'home.page.html', | |
styleUrls: ['home.page.scss'], | |
}) |