Why can't I access the "inner" functions of this object? I feel like this has worked before.
var OfflineStorage = (function () {
function OfflineStorage() {
var db = new Dexie("OfflineStorage");
db.version(1).stores({
articles: "ArtNo,Description,Unit"
});
}
function getArticlesByArtNo(params) {
var regex = new RegExp(params.search, "i");
return db.articles
.filter(function (article) { regex.test(article.ArtNo) })
.toArray();
}
return OfflineStorage;
})();
And when I try to access this object like so, I get an error.
var offlinestorage = new OfflineStorage();
offlinestorage.getArticlesByArtNo(); <-- This throws an error 'is not a function'