【发布时间】:2018-03-08 03:33:25
【问题描述】:
我想从这个函数返回一个布尔诺言,请帮忙?
getSectionsList() {
let sections: string[] = [];
var ref = this.db.database.ref(`instructors/jDlPCWMMJ8YmD9tMO3shTshM5sx1/sections`);
return ref.once('value').then(function (snap) {
var array = snap.val();
for (var i in array) {
var value = array[i];
sections.push(value.section)
//console.log(value.section)
}
if (sections.includes('SPRING_2018_CMPS333_L01'))
return (true)
else
return (false)
}).catch(function (err) {
console.log(err)
})
}
【问题讨论】:
-
对不起,这与我的问题无关。
标签: angularjs angular-promise guard canactivate