0
在角1,你可以像動畫放映添加CSS類的元素與NG秀一起,但同樣不能與角2的ngIf來完成,因爲該元素不會被渲染完全隱藏。在角1用於動畫放映如何在Angular 2中的ngIf上添加顯示/隱藏動畫?
CSS:
.animate-show.ng-hide-add, .animate-show.ng-hide-remove, .animate-hide.ng-
hide-add, .animate-hide.ng-hide-remove {
transition: all linear 0.2s;
}
.animate-show.ng-hide-add-active,
.animate-show.ng-hide-remove-active,
.animate-hide.ng-hide-add-active,
.animate-hide.ng-hide-remove-active {
/* the transition is defined in the active class */
transition: 1s linear all;
}
.animate-show.ng-hide-add, .animate-show.ng-hide-remove {
transition: all linear 0.2s;
}
.animate-show.ng-hide {
line-height: 0;
opacity: 0;
padding: 0 2px;
}
在角1,所有你需要的是一個CSS類「動畫秀」添加的元素,它是好去。
有沒有一種簡單的方法在Angular 2中實現這一點?
你在Angular 1.0中使用了哪些屬性來應用類名? – JEMI