Giter VIP home page Giter VIP logo

angular2-loki's Introduction

angular2-loki

Lokijs for angular2, Ionic 2, NativeScript with Angualr.

How to use

npm install angular2-loki
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' }));
  }
}

angular2-loki's People

Contributors

angular-cli avatar dimpu avatar

Stargazers

 avatar

Watchers

 avatar  avatar

angular2-loki's Issues

use lokijs adapters

first all, thanks for this library that you created. but need you help on how to make use of built in adapters like the LokiIndexedAdapter? thanks!

Not Found: angualr2-loki@latest

Hello,
I'm not able to install angular2-loki via npm:

$ npm install angualr2-loki --save
npm ERR! code E404
npm ERR! 404 Not Found: angualr2-loki@latest

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/.../.npm/_logs/2017-07-18T20_57_11_509Z-debug.log

Attached is the error log file. Any advice will be highly appreciated.

2017-07-18T20_57_11_509Z-debug.txt

Angular cli with angular 4 production build fails due to angular2-loki

Hello,

I am using angular2-loki in my angular-cli project.
It works as expected with dev build but fails on production build.
I researched a lot and some links suggested to contact the author. Here is my package.json for your reference.

Any help will be appreciated as I am unable to proceed because of this

{
  "name": "livechat_agent",
  "version": "1.0.0",
  "license": "MIT",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "4.3.5",
    "@angular/cdk": "2.0.0-beta.8",
    "@angular/cli": "^1.3.2",
    "@angular/common": "4.3.5",
    "@angular/compiler": "4.3.5",
    "@angular/core": "4.3.5",
    "@angular/flex-layout": "2.0.0-beta.8",
    "@angular/forms": "4.3.5",
    "@angular/http": "4.3.5",
    "@angular/material": "2.0.0-beta.8",
    "@angular/platform-browser": "4.3.5",
    "@angular/platform-browser-dynamic": "4.3.5",
    "@angular/router": "4.3.5",
    "@swimlane/ngx-charts": "6.0.1",
    "@swimlane/ngx-datatable": "9.3.1",
    "@swimlane/ngx-dnd": "2.2.0",
    "angular-2": "^1.0.0",
    "angular-calendar": "0.19.0",
    "angular-in-memory-web-api": "0.3.2",
    "angular2-loki": "^1.0.0",
    "arraybuffer-to-string": "^1.0.1",
    "body-parser": "^1.18.1",
    "classlist.js": "1.1.20150312",
    "core-js": "2.5.0",
    "cors": "^2.8.4",
    "d3": "4.10.0",
    "express": "^4.15.4",
    "firebase": "4.3.0",
    "hammerjs": "2.0.8",
    "highlight.js": "9.12.0",
    "intl": "1.2.5",
    "moment": "2.18.1",
    "ngx-color-picker": "4.3.1",
    "ngx-perfect-scrollbar": "4.5.5",
    "rxjs": "5.4.3",
    "socket.io": "^2.0.3",
    "socket.io-client": "^2.0.3",
    "split-lines": "^1.1.0",
    "ts-md5": "^1.2.2",
    "web-animations-js": "2.3.1",
    "zone.js": "0.8.16"
  },
  "devDependencies": {
    "@angular/cli": "1.3.1",
    "@angular/compiler-cli": "4.3.5",
    "@angular/language-service": "4.3.5",
    "@ngtools/webpack": "^1.6.1",
    "@types/jasmine": "2.5.53",
    "@types/jasminewd2": "2.0.2",
    "@types/node": "6.0.87",
    "codelyzer": "3.0.1",
    "jasmine-core": "2.6.2",
    "jasmine-spec-reporter": "4.1.0",
    "karma": "1.7.0",
    "karma-chrome-launcher": "2.1.1",
    "karma-cli": "1.0.1",
    "karma-coverage-istanbul-reporter": "1.2.1",
    "karma-jasmine": "1.1.0",
    "karma-jasmine-html-reporter": "0.2.2",
    "node-sass": "4.5.3",
    "protractor": "5.1.2",
    "ts-node": "3.0.4",
    "tslint": "5.3.2",
    "typescript": "2.3.3"
  }
}

and here is the error
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.