Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to call jQuery function in angularjs function

I want to know that how can I call a jQuery function in my angular function, like I've a jquery function like:

function testData(){
    // code
}

and I've a angular function like:

myApp.controller(AppCtrl,['$scope', function($scope) {
    $scope.imagesData = function(){
        //here I need to call the function: testData() 
    }
}]);

so, Please let me know that how can I call my testData() inside the angularjs function($scope.imagesData()). Thanks in advance.

like image 270
Dhana Avatar asked Sep 18 '15 04:09

Dhana


Video Answer


1 Answers

I tried this.I hope it might help. Js:

function testData(){

  return ("entering");
}

var myapp = angular.module("myapp",[]);
myapp.controller("ctrl",['$scope', function($scope) {

  $scope.imagesData = testData;

   console.log($scope.imagesData());
 }]);

Working Jsbin

like image 124
Praveen Raj Avatar answered Sep 21 '22 14:09

Praveen Raj