JSFiddle - React, Tailwind, and code Playground
JavaScript
$scope.$on('user', function onUserData (e, data) {
$scope.user = data.user;
$scope._userEditor = false;
if (data.user && data.user.company_id >= 0) {
CompanySvc.get(data.user.company_id)
.then(function (data) {
return $rootScope.$broadcast('company', data);
});
} else {
return $rootScope.$broadcast('newCompany');
}
_.forEach($scope.maillists, function (m) {
m.enabled = !!_.find(data.user.maillist, { maillist_id: m.maillist_id });
});
return;
});
/* this is a cut out of the above to focus on what I'm talking about from line 10. */
} else {
return $rootScope....
/* ^== My feeling is that when this runs it will end the whole function that started from $scope.on at the top. */
}
_.forEach($scope.maillists.... <== and will block this code from running