use gun for todo list

This commit is contained in:
Victor Noël
2017-04-18 15:54:30 +02:00
parent b4172a03b3
commit 46c9c63395
7 changed files with 83 additions and 10 deletions

View File

@@ -1,7 +1,10 @@
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { NgModule, Injectable } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { HttpModule } from '@angular/http';
import { Observable } from 'rxjs/Observable';
import Gun from 'gun/gun';
import { AppComponent } from './app.component';
@@ -14,7 +17,13 @@ import { AppComponent } from './app.component';
FormsModule,
HttpModule
],
providers: [],
providers: [GunDb],
bootstrap: [AppComponent]
})
export class AppModule { }
@Injectable()
export class GunDb {
readonly gun = Gun(location.origin + '/gun');
}