Hello.
I managed to create Blazor WASM application with Metronic theme and kit. I have now few errors:
1. System.IO.DirectoryNotFoundException
Unhandled exception rendering component: Could not find a part of the path '/wwwroot/assets/media/icons/duotune/arrows/arr061.svg'.
I assume this has something to do with how Blazor WASM access to data/files. After some debugging I found out problem is this function in KTTheme.cs file
public string GetSvgIcon(string path, string classNames)
{
var svg = System.IO.File.ReadAllText($"./wwwroot/assets/media/icons/{path}");
return $"<span class=\"{classNames}\">{svg}</span>";
}
protected override async Task OnAfterRenderAsync(bool firstRender)
{
//if(firstRender){
//await JS.InvokeVoidAsync("KTChartsWidget8.init");
//}
JS.InvokeVoidAsync("KTChartsWidget8.init");
}
href="?page=dashboards/ecommerce"
, shouldn't they point to /dashboards/eccomerce ?Hi,
Hi Lauris, thanks for answers.
1. Yes, I am following file structure. Also file with your path exists (I copied all from Blazor Server example). I think it has something to do with getting the file (Blazor WASM must use httpClient to get assest/files...
2. I don't really understand your answer. Can you give me example? I am calling OnAfterRenderAsync but it still does not show up.
3. Oh okay.
BR
Hi,
<SvgIcon IconPath="assets/media/icons/duotune/arrows/arr061.svg" />
KTChartsWidget8
initializes chart widget-8, for other widgets use different instances.console.log
displaying element variable of Starterkit/_keenthemes/src/js/widgets/charts/widget-8.js, then check result in your browser's console.