<commit_before>import cnode from '../cnode'
import angular from 'angular'

cnode.controller('TopicDialogController', ['$scope', '$mdDialog', 'API', 'TopicID', '$state', ($scope, $mdDialog, API, id, $state) => {
	$scope.gotoTopic = () => {
		$state.go('main.topic', {id})
		$scope.close()
	}

	$scope.id = id

	$scope.$on('TopicTitle', (e, title) => $scope.title = title)
	
	// API.getTopic(id).success(data => {
	// 	data.data.content = md.render(data.data.content)
		
	// 	data.data.replies.forEach(reply => {
	// 		reply.content = md.render(reply.content)
	// 	})
		
	// 	angular.extend($scope, data.data)
	// })
	
	$scope.close = () => {
		$mdDialog.hide()
	}
}])<commit_msg>fix click user link in dialog window doesn't close dialog<commit_after>import cnode from '../cnode'
import angular from 'angular'

cnode.controller('TopicDialogController', ƒ(($scope, $mdDialog, API, TopicID, $state) => {
	// for convinence
	let id = TopicID

	$scope.gotoTopic = () => {
		$state.go('main.topic', {id})
	}

	$scope.id = id

	$scope.$on('TopicTitle', (e, title) => $scope.title = title)

	// when change state, auto close this dialog
	$scope.$on('$stateChangeStart', e => {
		$scope.close()
	})

	$scope.close = () => {
		$mdDialog.hide()
	}
}))
{'fraction_non_alphanumeric': 0.2122679580306699, 'fraction_numerical': 0.0, 'mean_word_length': 3.714828897338403, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6315877', 'n_tokens_mistral': 476, 'n_tokens_neox': 454, 'n_words': 90}