Switch to using DI to acquire Node instances. Bump versions to alpha2.

This commit is contained in:
SteveSandersonMS
2015-11-02 13:35:14 -08:00
parent 301657a207
commit de991b9858
23 changed files with 103 additions and 92 deletions

View File

@@ -1,14 +1,21 @@
using System.Threading.Tasks;
using Microsoft.AspNet.Mvc;
using Microsoft.AspNet.NodeServices;
using Microsoft.AspNet.NodeServices.React;
namespace ReactExample.Controllers
{
public class HomeController : Controller
{
private INodeServices nodeServices;
public HomeController(INodeServices nodeServices) {
this.nodeServices = nodeServices;
}
public async Task<IActionResult> Index(int pageIndex)
{
ViewData["ReactOutput"] = await ReactRenderer.RenderToString(
ViewData["ReactOutput"] = await ReactRenderer.RenderToString(this.nodeServices,
moduleName: "ReactApp/components/ReactApp.jsx",
exportName: "ReactApp",
baseUrl: Request.Path