I am trying to get image width and height of an image that I pull from server in order to apply proper style for it. So I am using ng-repeat to fill template :
&
I don't know what you're trying to do, but it sounds like a job for a directive.
app.directive('styleParent', function(){
return {
restrict: 'A',
link: function(scope, elem, attr) {
elem.on('load', function() {
var w = $(this).width(),
h = $(this).height();
var div = elem.parent();
//check width and height and apply styling to parent here.
});
}
};
});
and you'd use it like so:
EDIT: If you're not using jquery, this will vary a little.