Can't you remove the setActiveTopic function entirely and use `ng-click="activeTopic = topic.id"` in topic.html?