javascript - Call jQuery function by Angular view -


is there way call jquery function in angularjs controller/view? example, want call slides function in 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();   }  }); 

create directive.

js:

 myapp.directive( "superslides",         function()         {             return {                 restrict: "a",                 scope: {},                 link: function ( scope, element, attrs )                 {                     $( element ).superslides();                 }             }         }     ) 

html:

<ul superslides> </ul> 

Comments

Popular posts from this blog

java - Spring Data JPA: Why findOne(id) executing delete query internally? -

python - Mongodb How to add addtional information when aggregating? -

java - Incorrect order of records in M-M relationship in hibernate -