I needed to initialize a jQuery plugin on all elements with a certain class name which comes inside an ng-repeat loop. These elements are loaded via angularjs $http get method.
var app = angular.module('myApp', []);
app.controller('myController', function($scope, $http) {
$http.get('get_item.php').success(function(response) {
$scope.items = response;
angular.element('.make-switch').bootstrapSwitch(); // jQuery plugin code
});
});
But this doesn't work.
I tried $('.make-switch').bootstrapSwitch(); also. Please help.
$('.make-switch').bootstrapSwitch();Provided you've included jQuery and this plugin script.