我有一个使用Asynch.forEachSeries迭代的数组.在迭代器内部,我找到了模型并进行了更新.我需要在更新发生后迭代第二个项目.找到下面的代码.
async.eachOfSeries(stockUpdate, function (valueSU, keySU, callbackSU) {
ProductVariations.findOne({id:valueSU.id}).exec(function (ePV,dPV){
dPV.available_stock = parseInt(dPV.available_stock) - Qty;
dPV.save(function (errDPV) {
callbackSU(); // HERE ONCE, NEXT ITERATOR SHOULD BE CALLED
});
});
}, function (err) {
if (err) callback(err.message);
});
Run Code Online (Sandbox Code Playgroud) 我的应用程序是用 NativeScript 开发的。对于 FCM,我使用nativescript-plugin-firebase.
每当我从 FCM 控制台尝试时,我都会收到推送通知。但是,当我从邮递员那里尝试时,我从未收到推送通知,如下所示。
URL : POST : https://fcm.googleapis.com/fcm/send
Headers : Authorization = key="******", Content-Type=application/json
Run Code Online (Sandbox Code Playgroud)
数据 :
{
"data": {
"title": "RAJA RAJA",
"message": "another test",
"name": "Muthukumar ME"
},
"to" : "**************************************"
}
Run Code Online (Sandbox Code Playgroud)
回复 :
{
"multicast_id": 5806593945960213086,
"success": 1,
"failure": 0,
"canonical_ids": 0,
"results": [
{
"message_id": "0:1521623661699559%161a06bff9fd7ecd"
}
]
}
Run Code Online (Sandbox Code Playgroud)
任何人都知道我错过了什么,即使我收到了成功的回复,当我尝试使用邮递员时,推送通知也不会到来。
我正在使用 Angular 材料日期选择器,如下所示。当日期选择器关闭时,我需要应用 CSS。仅供参考,我没有任何按钮来关闭弹出窗口
代码:
<input
matInput
#resultPickerModel="ngModel"
[matDatepicker]="pickerEndDate"
[(ngModel)]="endDate"
(click)="pickerEndDate.open()"
name="endDate"
[min]="minStartDate"
[max]="maxEndDateDate"
/>
<mat-datepicker #pickerEndDate></mat-datepicker>
Run Code Online (Sandbox Code Playgroud)
我的期望是我需要在日历关闭时应用 CSS。请帮我做到这一点
我有3个表,如user,userProfile和userProfileImages。User与userPrfoile尽可能多地userProfile映射,并且与userProfileImages尽可能多地映射。
我需要编写的查询顺序中userProfileImages,我尝试如下,但没有运气。
User.findById(uID, {
include: [
model: sequelize.models.userProfile
as: userProfile,
include: [
{
model: sequelize.models.userProfileImages,
as: 'profileImages',
}
],
order: [[sequelize.models.userProfileImages.id, "desc"]]
// order: [["id", "desc"]] --> Tried this way also no luck
] }
Run Code Online (Sandbox Code Playgroud)
我得到了结果,但是userProfilePicture表的结果却不尽如人意。
请给解决方案