【发布时间】:2018-07-28 01:47:26
【问题描述】:
我需要如下设置一个cookie:
start: number;
...
this.start = Math.floor(Date.now()/1000);
...
if(!this._cookieService.check('confirmTimeoutStarted')){
this._cookieService.set('confirmTimeoutStarted', this.start);
}
但我明白了:
error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'.
我应该定义 cookie 变量类型还是什么?
【问题讨论】:
标签: angular