Is there a way to call a jQuery function only in a certain Angularjs controller/view? For example, I want to call the slides function only in the home view.
Slides:
$('.slides').superslides();
app.js:
var myApp = angular.module('myApp', ['ngRoute']);
myApp.config(['$routeProvider', '$locationProvider', function($routeProvider, $locationProvider) {
$routeProvider
.when('/', {
templateUrl : 'views/home.html',
controller : 'mainController'
});
$locationProvider.html5Mode(true).hashPrefix('!');
}]);
myApp.controller('mainController', function($scope, $location, $anchorScroll) {
$scope.scrollTo = function(id) {
$location.hash(id);
$anchorScroll();
}
});