我正在尝试为拖放时的* ngFor元素动画设置动画。尽管两个元素的状态都在放置处理程序中更改(letter.animation = 'none'
-> 'swapped'
,但仅触发了一个动画。
我尝试删除发生交换的行([this.letters[previousIndex], this.letters[currentIndex]] = [this.letters[currentIndex], this.letters[previousIndex]];
),并且两个元素都变为动画。但是我不明白为什么当我增加交换时只有一个触发。是时间问题吗?
StackBlitz示例代码在这里: https://stackblitz.com/edit/angular-zqclw5
谢谢!
答案 0 :(得分:0)
您对计时问题的直觉起作用了……添加了setTimeout以获取所需的效果:
app.component.ts 中的更新功能:
import firebase_admin
from firebase_admin import credentials
cred = {
"type": "service_account",
"project_id": "xxxxxxxxx",
"private_key_id": "xxxxxxxxxx",
"private_key": "",
"client_email": "",
"client_id": "",
"auth_uri": "",
"token_uri": "",
.............
}
firebase_admin.initialize_app(cred)
email = request.POST.get('email')
link = firebase_admin.auth.generate_email_verification_link(email)