无法在 $firebaseArray 中显示数据
failed to display data in $firebaseArray
我试图通过 $firebaseArray 在 html 上显示我的 firebase 数据。为什么没有显示?
我的数据是这样的(在 firebase dash 上查看),
我的代码大致是这样的(不完整,但我觉得足以演示问题),
http://jsfiddle.net/bp6cp0sh/3/
html:
<body ng-app = "testApp">
<div ng-controller="angularfirecontroller">
<ul>
<li np-repeat="message in messages">
{{message.user}}
</li>
</ul>
</div>
</body>
javascript:
var testApp = angular.module("testApp", ["firebase"]);
testApp.controller("angularfirecontroller", function($scope, $firebaseArray){
var dataRef = new Firebase("https://boiling-inferno-1234.firebaseio.com/messages");
$scope.messages = $firebaseArray(dataRef);
});
您的 ng-repeat
有错字。 np-repeat
应该是 ng-repeat
.
Fiddle: http://jsfiddle.net/3448besj/
我试图通过 $firebaseArray 在 html 上显示我的 firebase 数据。为什么没有显示?
我的数据是这样的(在 firebase dash 上查看),
我的代码大致是这样的(不完整,但我觉得足以演示问题), http://jsfiddle.net/bp6cp0sh/3/
html:
<body ng-app = "testApp">
<div ng-controller="angularfirecontroller">
<ul>
<li np-repeat="message in messages">
{{message.user}}
</li>
</ul>
</div>
</body>
javascript:
var testApp = angular.module("testApp", ["firebase"]);
testApp.controller("angularfirecontroller", function($scope, $firebaseArray){
var dataRef = new Firebase("https://boiling-inferno-1234.firebaseio.com/messages");
$scope.messages = $firebaseArray(dataRef);
});
您的 ng-repeat
有错字。 np-repeat
应该是 ng-repeat
.
Fiddle: http://jsfiddle.net/3448besj/