Closed nvahalik closed 3 years ago
@nvahalik do you mind creating a PR for this issue?
@marcjulian Sure. I'm working on it now.
Looks like this should already work based on how it's configured. It doesn't really make sense, but perhaps the issue here is a build problem and not a code problem?
When I use my locally built version of the plugin, using a StateModel
works as expected. However, upon switching back to the latest release, it fails. The failure is in the transformKeyOption
function:
It reports that StateModel
is undefined.
I'm unfamiliar enough with how these modules are built to know where to go from here.
The above was tested w/ Firefox 79 and the project is being used with the IonicAsyncStorageService
driver (um, copy-pasted from the repo...) on an Ionic 4 project using Angular 7.
Ah, OK. I figured out what was going on. PR submitted! #158
Note that I was still having problems with using StateToken directly in the key
list, but this appears to be some sort of AoT issue and not related to any bug in this plugin. I will close out this ticket.
Currently the
key
option for the importing of the plugin only allows for State Tokens and strings. This causes an error (#123) if you pass in aStateModel
.It should be fairly easy to suppose a
StateModel
object since it has aname
attribute which is the value that needs to be examined rather than thekey
itself.Just check to see if the key is a
StateModel
and if it is, the "real name" iskey.name
rather thankey
.