updated HtmlText module to use dependency injection

This commit is contained in:
Shaun Walker
2020-05-12 15:04:07 -04:00
parent 53f454e370
commit 9eec0fd86b
3 changed files with 11 additions and 22 deletions

View File

@ -1,21 +1,13 @@
@using Oqtane.Modules.HtmlText.Services
@using Oqtane.Modules.HtmlText.Models
@namespace Oqtane.Modules.HtmlText
@inherits ModuleBase
@inject NavigationManager NavigationManager
@inject HttpClient http
@inject SiteState sitestate
@inject IHtmlTextService HtmlTextService
@((MarkupString)content)
@if (PageState.EditMode)
{
<br />
}
<ActionLink Action="Edit" />
@if (PageState.EditMode)
{
<br /><br />
<br /><ActionLink Action="Edit" /><br /><br />
}
@code {
@ -25,8 +17,7 @@
{
try
{
var htmltextservice = new HtmlTextService(http, sitestate);
var htmltext = await htmltextservice.GetHtmlTextAsync(ModuleState.ModuleId);
var htmltext = await HtmlTextService.GetHtmlTextAsync(ModuleState.ModuleId);
if (htmltext != null)
{
content = htmltext.Content;