0
TypeKit에서 글꼴을 적용하기 전에 지시문이 실행되기 때문에 위치가 올바르지 않습니다.TypeKit이 글꼴을로드 한 후 AngularJS 지시문을 실행하십시오.
app.directive('myDirective', function(){
return {
restrict: 'A',
link: function(scope, elem, attrs){
var active = elem.children('li.active');
console.log(active[0].offsetLeft); // <-- This is wrong
elem.bind('click', function(){
var active = elem.children('li.active');
console.log(active[0].offsetLeft); // <-- This is correct
});
}
};
});
글꼴을로드 한 후 지시문을 가져 오는 방법에 대한 아이디어가 있습니까?