我读了这么多博客,它说有一个错误
$scope.logout = function() {
$ionicHistory.clearCache();
$ionicHistory.clearHistory();
$state.go('home');
};
Run Code Online (Sandbox Code Playgroud)
有没有使用离子代码或使用一些角度代码清除缓存的解决方案?
我在用 Notification.permission
用于检查浏览器是否允许通知。
我的代码,用于检查通知权限,如下所示。
// Let's check if the browser supports notifications
if (!("Notification" in window)) {
alert("This browser does not support desktop notification");
}
var prm = Notification.permission;
if (prm == 'default' || prm == 'denied') {
console.log("permission denied or default");
}else{
console.log("permission granted");
}
Run Code Online (Sandbox Code Playgroud)
这段代码在我中运行正常,localhost
但是当我尝试在生产环境中使用时,它始终会处于拒绝状态。我的浏览器通知设置始终在此站点上允许。
但我不知道是什么问题。需要帮助。
我想根据来自webapi的json对象生成带有动态表头和行/列的动态表.
以下是每次都有不同的json对象示例.
[
{"Country":"Australia","Toner Quantity":8},
{"Country":"China","Toner Quantity":6},
{"Country":"India","Toner Quantity":11},
{"Country":"South Korea","Toner Quantity":1}
]
Run Code Online (Sandbox Code Playgroud)
它有一段时间了
[
{"CustomerName":"FORD","Australia":0,"China":2,"India":0,"South Korea":0},
{"CustomerName":"ICICI PRUDENTIAL","Australia":0,"China":0,"India":5,"South Korea":0},
{"CustomerName":"Kimberly Clark","Australia":0,"China":0,"India":0,"South Korea":1},
{"CustomerName":"McDonalds","Australia":1,"China":0,"India":0,"South Korea":0},
{"CustomerName":"Novartis","Australia":1,"China":0,"India":0,"South Korea":0},
{"CustomerName":"Origin Energy","Australia":3,"China":0,"India":0,"South Korea":0}
]
Run Code Online (Sandbox Code Playgroud)
所以我尝试过但无法实现带有标题和行/列的动态表
我的HTML代码就像
<table class="table striped">
<thead>
<tr role="row">
<th ng-repeat="th in dataconfigureListData.previewData">{{th}}</th>
</tr>
</thead>
<tbody>
<tr role="row" data-ng-repeat="previewData in dataconfigureListData.previewData">
<td> {{previewData.Country}}</td>
<td> {{previewData['Total Toner Qty']}}</td>
</tr>
</tbody>
</table>
Run Code Online (Sandbox Code Playgroud)