Comments (3)
So after a lot of trial and error I was finally able to get this to work. It required me to do three things:
- Add the indexedDb.Blazor.js file to my project and include it in my _Host.cshtml file using a <script> tag
- In the Startup.cs I had to add it to the services as a transient: services.AddTransient<IIndexedDbFactory, IndexedDbFactory>();
- In the indexedDb.Blazor.js I had to change the line instanceWrapper.instance.invokeMethod(instanceWrapper.methodName, "Hello from the other side"); to instanceWrapper.instance.invokeMethodAsync(instanceWrapper.methodName, "Hello from the other side");
Once I did those three things the library worked successfully. I was able to add, retrieve, and remove entries from the IndexedDB in Chrome. Not sure why I had to make those three changes, but hopefully it will help someone else.
from blazor.indexeddb.framework.
Hi, would it be possible for you, if the issue persisted, to maybe provide an example project where the issue is reproducible?
Sadly I currently don't have to much time so it may take a while for me to come back at you.
Thank you for your patience :)
from blazor.indexeddb.framework.
So after a lot of trial and error I was finally able to get this to work. It required me to do three things:
- Add the indexedDb.Blazor.js file to my project and include it in my _Host.cshtml file using a <script> tag
- In the Startup.cs I had to add it to the services as a transient: services.AddTransient<IIndexedDbFactory, IndexedDbFactory>();
- In the indexedDb.Blazor.js I had to change the line instanceWrapper.instance.invokeMethod(instanceWrapper.methodName, "Hello from the other side"); to instanceWrapper.instance.invokeMethodAsync(instanceWrapper.methodName, "Hello from the other side");
Once I did those three things the library worked successfully. I was able to add, retrieve, and remove entries from the IndexedDB in Chrome. Not sure why I had to make those three changes, but hopefully it will help someone else.
Hi dmarciano can you please tell me where can i get indexeddb.blazer.js file
from blazor.indexeddb.framework.
Related Issues (7)
- Write weaver like pre compile time event
- Cannot access database from OnAfterRender lifecycle method HOT 1
- Could not load type 'Microsoft.JSInterop.DotNetObjectRef' from assembly 'Microsoft.JSInterop, Version=3.0.0.0, Culture=neutral HOT 4
- Upgrade package to use .NET core 3.0
- Switch to C# 8.0
- FK Support HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from blazor.indexeddb.framework.