You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

angular2-loki

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular2-loki

Lokijs for angular2, Ionic 2, NativeScript with Angualr.

1.0.0
latest
npmnpm
Version published
Weekly downloads
4
-20%
Maintainers
1
Weekly downloads
 
Created
Source

angular2-loki

Lokijs for angular2, Ionic 2, NativeScript with Angualr.

How to use

npm i angualr2-loki --save

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { LokiModule } from './loki/loki.module';
import { AppComponent } from './app.component';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    LokiModule,
    .....
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }
import { Component } from '@angular/core';
import { LokiService } from 'angular2-loki';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent {
  constructor(private loki: LokiService) {
    let db = loki.init('mydb.txt');
    // db will export lokijs object
    // full docs at https://rawgit.com/techfort/LokiJS/master/jsdoc/Loki.html
    let users = db.addCollection('users');
    users.insert({
        name: 'Odin',
        age: 50,
        address: 'Asgard'
    });

    console.log(users.findOne({ name: 'Odin' }));
  }
}

FAQs

Package last updated on 26 Oct 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts