My directive contains an javascript object. I try to find with jquery all html elements which are binding to this javascript object. How can I get the binded data of the angularjs object with jquery?
Maybe the above code explains better my plan.
angular.module('app').directive('highlight', [
'$rootScope', '$compile', function ($rootScope, $compile) {
return {
replace: true,
templateUrl: 'highlight.html',
link: function (scope, element, attrs) {
//this data object do we need to highlight
scope.Tohighlight;
$($.find('input, select')).each(function () {
//todo extract data if input or selection are binding data
//<input type="x" data-ng-model="data" /></span>
var data = angular.extractDataFromhtmlelement($(this));
//if html element contains our data add some css stuff
if(data == scope.Tohighlight)
{
}
});
};
}
]);
I don't know if there exists an angularjs method for my purpose. How can I get the binded angularjs data model of an jquery object? Thanks.