Let's say I have two states:
.state('page1', {
url: '/page1',
templateUrl: 'pages/templates/page1.html',
controller: 'page1'
})
.state('page2', {
url: '/page2',
templateUrl: 'pages/templates/page2.html',
controller: 'page2'
})
They both have the element <div id="clickme'>DO IT</div>
.
In one controller I have:
$("body").on('click', '#clickme', function(e) { alert("clicked"); });
But not on the other controller.
What is the most effective way to restart my bindings if I have a lot of these separately going on within my different controllers?
I don't want them to be active when I switch state's because some things may overlap or just want to make sure nothing overlaps.