[question] How to use vash.helpers.include
Opened this issue · 1 comments
Hello Together
First of all many thanks for Razor Views under Javascript.
I have a question about vash.helpers.include I'm not quite sure how the method is used.
I work with Nodejs 8.x, express 4.18, Typescript and vash 0.12.4.
Now you would like to include a "Partial View" in a page.
I heard it from Razor:
@await Html.PartialAsync("PartialName", Data)
I think the method "vash.helpers.include" unfortunately does not work.
Can somebody help me? What's missing?
index.ts
router.get('/', async (req: express.Request, res: express.Response) => {
try {
res.render('index', {
title: 'Index',
authentication: res.locals,
});
} catch (e) {
}
});
Index.vash
@html.extend('layout', function(model){
@html.block('content', function(model){
@vash.helpers.include('test', null);
})
})
Test.vash (PartialView)
<div class="container">
<div class="row">
<div class="col-sm-12">
<h2>Test</h2>
</div>
</div>
</div>
Best Regards
Jan
Edit:
Sorry my mistake : => @html.include('Test', null);
I haven't tested vash with a recent version of express. When you run your code, are you seeing anything odd in your output? Such as [VASHMARK-
? If so, the issue is probably this one: #35 (comment)
Basically, a function must be called to signal to vash that rendering has finished.