Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/firebase/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angularjs Angularfire上的Foreach-避免迭代方法?_Angularjs_Firebase_Angularfire - Fatal编程技术网

Angularjs Angularfire上的Foreach-避免迭代方法?

Angularjs Angularfire上的Foreach-避免迭代方法?,angularjs,firebase,angularfire,Angularjs,Firebase,Angularfire,我正在从firebase检索一些数据,这给了我一个类似以下内容的对象: $add: function (item) { $auth: function (token) { $bind: function (scope, name, defaultFn) { $child: function (key) { $getIndex: function () { $getRef: function () { $id: "tasks" $off: function (type, callback) { $

我正在从firebase检索一些数据,这给了我一个类似以下内容的对象:

$add: function (item) {
$auth: function (token) {
$bind: function (scope, name, defaultFn) {
$child: function (key) {
$getIndex: function () {
$getRef: function () {
$id: "tasks"
$off: function (type, callback) {
$on: function (type, callback) {
$remove: function (key) {
$save: function (key) {
$set: function (newValue) {
$transaction: function (updateFn, applyLocally) {
$update: function (newValue) {
-JLCrhLLGqp-OZN-9toC: true
-JLCrkqFxxxaV6eG8lrb: true
__proto__: Object
我需要迭代所有看起来像“-jlcrhlgqp-OZN-9toC”的键

我的问题是我如何做到最好?我可以删除$methods吗

在html中使用ng repeat很容易做到这一点,ng repeat似乎可以找出应该忽略的部分。但我不知道如何在控制器上进行

在迭代属性时,可以使用角度函数:

angular.forEach( $scope.firebaseObject, function(value, key){
  if( !angular.isFunction(value)){
    alert(key + ' is not a function');
  }
});

这很好用,我只是在想有一种更具角度感的方法来做这件事?哦,我没有意识到angular有一个isFunction。已更新答案以使用它而不是instanceof。