Currently, I am facing a situation where I have two separate views that I would like to control within a single controller.
The issue is, the controller is being executed twice. Is there a way to link multiple views to the same controller without the controller running more than once?
I understand that creating a factory to share $scope data might be necessary, but the aim is to avoid fetching the data repetitively.
.state('cloud', {
url: '/cloud',
views: {
'main': { templateUrl: 'main.html', controller: 'cloud' },
'second': { templateUrl: 'second.html', controller: 'cloud' }
}
})