我尝试在ngAfterViewInit()
ngAfterViewInit() {
this.gagSlider();
}
gagSlider()函数
gagSlider(){
$.fn.animateRotate = function(angle, duration, easing, complete) {
alert(1);
return this.each(function() {
var $elem = $(this);
$({deg: 0}).animate({deg: angle}, {
duration: duration,
easing: easing,
step: function(now) {
$elem.css({
transform: 'rotate(' + (-90 + ((90 * 180) / 100)) + 'deg)'
});
},
complete: complete || $.noop
});
});
};
$('.meter-clock').animateRotate(0);
}
我成功获得警报但轮换无法正常工作