I don’t know what you are trying to do, but it seems 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();
});
}
};
});
and you will use it like this:
<img ng-src="imageFile" style-parent/>
EDIT: jquery, .