In a Angular App i am using ui-router to handle navigation etc. In a separate script file, i have a function like so;
$(function () {
function doSomething(){
if ($('.thisclass').length) {
$('.thisclass').css({ 'height': someHeight });
}
}
});
My problem is, that whenever the state changes, i want to run the above function. But as it is not part af any Angular function, i get an error when i reference it, as i cannot find it.
What should i be doing, instead of the above?
$()?the $routeChangeStart$(function(){ function doSomething() { /* ....... */ } });dofunction doSomething() {/* ..... */}. But it would pose a security risk! I would not suggest that, as @Zamboney mentioned, its quick and dirty ... :)