Guest User

Untitled

a guest
Nov 23rd, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. import { Component, OnInit } from '@angular/core';
  2.  
  3. declare let electron: any;
  4.  
  5. @Component({
  6. selector: 'app-root',
  7. templateUrl: './app.component.html',
  8. styleUrls: ['./app.component.css']
  9. })
  10. export class AppComponent implements OnInit {
  11. title = 'app';
  12. public sqlite3 = electron.remote.getGlobal('sqlite3');
  13.  
  14. constructor () {}
  15.  
  16. ngOnInit() {
  17. const me = this;
  18. console.log(me.sqlite3);
  19. const db = new me.sqlite3.Database('test.sqlite3');
  20. db.serialize(function() {
  21. db.run('CREATE TABLE lorem (info TEXT)');
  22. });
  23. }
  24. }
Add Comment
Please, Sign In to add comment