I have created the jsFiddle to describe my problem. http://jsfiddle.net/rzajac/MMud3/
The directive itself is here:
var myApp = angular.module('myApp', []);
myApp.directive('map', function(){
return {
restrict: 'E',
scope: {},
link: function(scope, elem, attrs)
{
elem
.height(400)
.width(600)
.vectorMap({
map: 'usa_en',
backgroundColor: null,
color: '#ffffff',
hoverColor: '#999999',
selectedColor: '#666666',
enableZoom: false,
showTooltip: true
});
document.getElementById('mapHeight').value = elem.height();
}
}
});
The directive is creating html and SVG elements inside itself. But when I'm trying to get the height of created map i get 19 instead of 400. What am I doing wrong?