0
私は火災基地で作業していますが、残念ながら私がrespUserをコンソールに置いたときに[object object]
を与えた場合、私はJSON.Stringify
を入力しようとしました。 JSONに、円形の構造は、その後、私は変換するのにangular.toJson
を使用しますが、それはそう私を助けてください動作しませんでした、 は、以下の私のコード..あなたが作成するための「文字列化」を使用する必要がありJsonに変換するときにエラーが発生しました
$scope.logIn = function() {
firebase.auth().signInWithEmailAndPassword($scope.email, $scope.password).then(function (user) {
console.log(user);
$scope.populateUserLocally(user);
}).catch(function (error) {
var errorCode = error.code;
var errorMessage = error.message;
console.log(errorMessage);
});};
$scope.populateUserLocally = function (respUser) {
$scope.userDetails = angular.toJson(respUser); console.log("$scope.userDetails"); };
あなたは 'respUser.val()'を使用するべきです –
あなたはplunkrを提供できますか –