AngularJS - Simple $scope console.log() returns undefined

前端 未结 2 762
说谎
说谎 2021-01-11 20:48

I\'m trying to make a simple console.log() from this $scope:

2条回答
  •  时光说笑
    2021-01-11 21:33

    Because your JS code

    console.log($scope.customer);
    

    run when you init the CustomerController controller, at that time $scope.customer has no value and it return undefined.

提交回复
热议问题