You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Techfort edited this page Apr 20, 2015
·
1 revision
LokiJS can easily be integrated in angular by using lokiAngular.js, which is in the src/ folder.
assuming your app is called 'myApp', you would integrated LokiJS like so:
angular.module('myApp',['lokijs']).controller(MyCtrl,['$scope','Loki',functionMyCtrl($scope,Loki){$scope.db=newLoki('myDb');$scope.db.loadDatabase({},loadHandler);functionloadHandler(){$scope.users=$scope.db.getCollection('users');// your logic here ...}}]);