1
我想在数据库中添加一行,在此之后,重新加载当前页面以更新新数据,但是当我使用$ state.reload()时,所有页面变黑并且我无法与此页面进行互动。
DeviceService.addDevice($scope.newDevice).then(function (result) {
if (result.data.success) {
flash.success = result.data.message;
// current state is 'profile' and I want to reload to update data
$state.go('profile', {}, { reload: true });
} else {
flash.error = result.data.message;
}
});
更新: 我想,也许是因为我用一个模式来添加设备。无论如何解决它?如何在重新加载状态之前关闭模态。我使用的引导模式文件profile.html内
是否'profile'国家采取任何PARAMS?另外,为什么不直接从'DeviceService'调用get all device API,而不是重新加载整个页面呢? – Sajal
它看起来像叠加的模式,你使用模式来添加新的设备? –
@Sajal'个人资料'不包含任何参数。因为获取所有设备API在启动状态时运行,所以我想重新加载状态以再次运行。 –