我已成功将信息放入PouchDB,但如何使用AngularJS检索数据并以HTML格式显示?
var db = new PouchDB('infoDB');
function getData(){
$.getJSON('test.json', function(data) {
var row = data[0].Row;
var info = [];
db.destroy().then(function () {
return new PouchDB('infoDB');
}).then(function(db){
for (var i = 0; i < row.length; i++) {
var info = {
_id: row[i].id,
name: row[i].name,
email: row[i].email,
age: row[i].age
}
db.put(info).then(function(result){
console.log("Everything is ok!");
}).catch(function(err){
console.log('Oh No!');
console.log(err);
});
}
});
});
}
getData();
答案 0 :(得分:0)
查找从pouchdb数据库中提取文档。
在他们的网站上他们简要解释: https://pouchdb.com/api.html#fetch_document
获取特定文档,查看find插件: https://nolanlawson.github.io/pouchdb-find/ 它易于使用,也适用于Couch 2.0。
我害怕我无法帮助你。