5

According to LokiJS: in-memory NoSQL datastore for Cordova apps

I embedded loki-angular.js and then write the following script:

var onsen = angular.module('app', ['onsen', 'lokijs'])
  .config(['$httpProvider', function($httpProvider) {
}]);

After that, I write a controller and then test on browser and get a error:

onsen.controller('ListController', ['$scope', 'Loki', function($scope, Loki) {
}]);

The error is:

ReferenceError: loki is not defined
at Object.Loki (.../loki-angular.js:29:16)
at Object.invoke (https://code.angularjs.org/1.2.12/angular.js:3710:17)

I just follow the guide from the post so I am not sure what's wrong and how to fix it.

Experts please help!

Joe Minichino
  • 2,793
  • 20
  • 20
fmchan
  • 760
  • 1
  • 11
  • 29
  • it just looks to me as if you did not include the main lokijs file, or that the angular adapter is wrong. Are you using the latest version of LokiJS (1.3.11)? can you share some code? – Joe Minichino Jan 14 '16 at 06:41

0 Answers0