TheCocoaProject / cordova-plugin-nativestorage

Cordova plugin: Native storage of variables in Android, iOS and Windows
http://thecocoaproject.github.io/
Apache License 2.0
292 stars 106 forks source link

$cordovaNativeStorage.clear is not a function #45

Closed dmr07 closed 8 years ago

dmr07 commented 8 years ago

Error when calling NativeStorage.clear:

Uncaught TypeError: $cordovaNativeStorage.clear is not a function

    console.log($cordovaNativeStorage); // 3 methods - get, set, and remove. does not include clear. 
    var deferred = $q.defer();
    $cordovaNativeStorage.clear(function() { // throws 
      console.log('storage: cleared')
      deferred.resolve()
    }, function(err) {
      console.log(err);
    })
    return deferred.promise;
GillesC commented 8 years ago

This issue should be placed in the correct repo, i.e. ngcordova-wrapper-nativestorage.

As the docs state, the clear function is not yet implemented. But I've merged a PR with a clear function so the current repo should now provide a proper clear function. So please reinstall the wrapper. REMARK: The docs need to be updated to contain the clear functionality.

dmr07 commented 8 years ago

Oops, didn't see that. My mistake.

GillesC commented 8 years ago

Hope the PR (pull request) solved your issue.

On Wed, 2 Nov 2016, 23:06 Daniel Meng, notifications@github.com wrote:

Oops, didn't see that. My mistake.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/TheCocoaProject/cordova-plugin-nativestorage/issues/45#issuecomment-258014197, or mute the thread https://github.com/notifications/unsubscribe-auth/AIOhixIOtmYwVqKfmBjFgmEf14s6B1Psks5q6Ql_gaJpZM4KnBuz .