我devolping使用離子framework.This一個網站是我的代碼:AngularJS等待HTTP事件成功
$rootScope.$on('$cordovaPush:tokenReceived', function(event, data) {
storageService.save("deviceToken", data.token);
});
var devicetoken =JSON.parse(storageService.get("deviceToken"));
HomeOwners.Create(devicetoken).then(function(response) {
console.log(response.user_id);
})
alert(devicetoken);
但這警報null.When我刷新頁面的I T alret我設備令牌值。
請幫助
您可以添加「storageService」代碼嗎? –