發表文章

目前顯示的是 4月 13, 2019的文章

How to properly annotate an abstract base component with life cycle hooks in Angular

圖片
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box; } 1 I have an abstract base component with life cycle hooks: export abstract class BaseComponent implements OnChanges, OnInit { ngOnChanges(changes: SimpleChanges): void { … } ngOnInit() { … } } And a child component: @Component({ … }) export class ChildComponent extends BaseComponent { This will result in Can't resolve all parameters for BaseComponent: (?, ?, ?). The parameter indeed has three parameters. All three values are listed in the providers section of the module containing the child component. Adding the base component to the module is not possible since it is not compatible wit...

Maintaining a CSS translate3d position when swapping classes

圖片
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box; } 2 1 I have an infinite scrolling background image in a div as you can see in the below snippet. The idea behind this is that its a timeline that I can change the speed of, ie. Normal speed, Fast, Slow and even Reverse. Using javascript I can successfully change the "speed class" that I have on the div and the image will successfully update to the speed and direction that I wish it to go. However my issue is that when I'm changing class, I lose the relative translate3d position of the image, so as the class changes, the background image location gets reset and then the new animation starts. I've tried to addre...