我的问题是关于chat.js中的_metaConnect函数。这是功能:
function _metaConnect(message) {
if (!$scope.joined) {
$scope.connected = false;
_connectionClosed();
} else {
var wasConnected = $scope.connected;
$scope.connected = message.successful === true;
if (!wasConnected && $scope.connected) {
_connectionEstablished();
} else if (wasConnected && !$scope.connected) {
_connectionBroken();
}
}
}
具体来说,该行是什么
$scope.connected = message.successful === true;
完成?
答案 0 :(得分:1)
$scope.connected
获取message.successful === true
的值。
message.successful === true
的值为message.successful
,则 true
的值为true;如果message.successful
具有任何其他值,则值为false。