2015-10-13 26 views
0

在角我想:

$localStorage.clear(); 

它得到了錯誤:

$localStorage.clear is not a function

什麼是正確的調用約定全殲$localStorage

回答

3

如果您正在使用ngStorage你可以嘗試$ $的localStorage復位()。而不是clear()。

這種方法明確的是默認的HTML5方法,使用它,你必須脫掉$,如:localStorage.clear()

+1

無需付$ – toddmo