单击注销按钮不起作用时清除本地存储,我也没有使用控制器文件进行操作,我只使用.ts和.HTML并且我在制作函数时出错,是否有没有方法可以在不制作函数的情况下做到这一点?Angular 有什么特性吗?
这是我的HTML 文件
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 19.315" width="20">
<g id="logout" transform="translate(0
-1.66)" > </svg>
这是我的ts 文件
public articlepara = { clientid: localStorage.getItem('storageselectedclient'), page: 1, type: 'All', keytype: '', sortdate: 'asc', sortpub: '', sortnews: '', fromdate: this.fromdate, todate: this.todate, publicationFilter: '', sortprominence: '' }
user = {
email: localStorage.getItem('email')
}
constructor(public article: ArticleService, http: HttpClient, elementRef: ElementRef, public _client: ClientService, private spinnerService: Ng4LoadingSpinnerService, private helper: HelperService, excelService: ExcelService, private filterPipe: FilterPipe) {
}
ngOnInit() {
$("#reset").hide();
var self = this;
// $(document).ready(function(){
$("#dateclick").click(function () {
$('#rangeCal').toggle();
})
updateConfig();
function updateConfig() {
var options: { dateLimit: String } = {
dateLimit: ""
//,minDate: moment().subtract(365, 'days') , maxDate: moment()
};
$('#config-demo').daterangepicker(options, function (start, end, label) {
var startDateRange = end.format('YYYY-MM-DD');
var endDateRange = start.format('YYYY-MM-DD');
self.articlepara.todate = endDateRange;
self.articlepara.fromdate = startDateRange;
self.spinnerService.show();
self.isActiveToday = false;
self.isActive7Days = false;
self.isActiveYesterday = false;
self.isActivedaterange = true;
});
}
函数式编程
翻翻过去那场雪
PIPIONE
相关分类