function infoboxController($scope)
{
$scope.current_view_ = myGlobalInstance.current_view_;
$scope.$watch($scope.current_view_,
function(newValue, oldValue)
{
console.log(newValue);
console.log(oldValue);
console.log($scope.current_view_);
if($scope.current_view_!=null)
$scope.dataset = $scope.current_view_.dataset;
}
);
}
コンソール出力
undefined infobox.js:10
undefined infobox.js:11
null
myGlobalInstance は、私が作成した JS クラスのインスタンスです。その current_view_ は最初は null ですが、インスタンスの作成後に値に設定されます