Questions tagged [vash]

Vash is a template engine using Razor syntax, for JavaScript templates

Vash is a template engine using Razor Syntax for javascript based language (NodeJs/Express or Vanilla, RequireJS).

link to github repo

17 questions
4
votes
1 answer

node.js : rendering error with vash

I'm getting a rendering error in node.js with vash. I'm really struggling to see what the issue is. Below is the error and the code causing the error. TypeError: Problem while rendering template at line 4, character 2. Original message: object is…
nomongo
  • 3,435
  • 7
  • 30
  • 33
3
votes
1 answer

Syntax highlighting not working for Node.js Vash view files in Visual Studio 2015 Update 3

In Visual Studio 2015 Update 3 I am building a Node.js application and am using Vash as the view engine. However, when I write HTML in the vash files, the syntax highlighting is not working. It just shows up as plain text. So for example, this:…
joshmcode
  • 3,471
  • 1
  • 35
  • 50
3
votes
1 answer

Node view engines using Angular

Is there a node view engine that works in conjunction with Angular? Coming from a .NET background VASH seemed like it'd make the most sense however I wasn't able to render a basic {{ 1 + 3 }} expression to ensure my Angular import is working. I also…
3
votes
1 answer

Send data through a script tag using nodejs vash template

I am new to nodejs. Trying to send some bootstrapped data (logged on user) from a nodejs server using the vash template back to the client with the index page. Need the bootstrapped data on the client to enable/disable certain options based on…
Hemant
  • 41
  • 1
  • 5
2
votes
0 answers

The way to upload file on NodeJS server using Ajax

Recently I had an issue on how to upload the file to NodeJS server using AJAX, so after many struggles, I finally succeeded to do that. I posted questions on some developers' spaces to get help, I'd like to share my solutions for others people.…
2
votes
1 answer

Can not load template in Vash

I am using Vash as my template engine. I want to have header and footer in a separate file that I want to include in layout.vash layout.vash
@html.block('header')
@html.block('content')
Chirdeep Tomar
  • 4,281
  • 8
  • 37
  • 66
1
vote
1 answer

Node.js + Append to model before rendering a view

I am building a website using Node.js and Express. For my view engine, I'm using Vash. In my app, I have a layout.vash file I'm using as the main layout for my app. It looks something like this: layout.vash …
JQuery Mobile
  • 6,221
  • 24
  • 81
  • 134
1
vote
0 answers

How can I use Vash and Razor at the same time?

I'm developing an application with ASP.NET MVC, in my view I'm using Razor as a template engine for my server side code. I was searching for a template engine for my client side code and I found Vash. as you probably know Vash has a pretty clean…
Sirwan Afifi
  • 10,654
  • 14
  • 63
  • 110
1
vote
1 answer

How to find the source of 'write after end'

Sometimes, my (large) application gives the following error: Error: write after end at ServerResponse.OutgoingMessage.write(_http_outgoing.js:413:15) at…
Luca Steeb
  • 1,795
  • 4
  • 23
  • 44
1
vote
1 answer

Configure Sails.js to use Vash view engine

I have been trying to find information on how to configure Sails to use the Vash view engine. I am not sure if it is possible or not, as it seems view engines that are compatible with Sails must be based on consolidate.js. I'm not sure if Vash is…
jrista
  • 32,447
  • 15
  • 90
  • 130
0
votes
1 answer

Change default file extension for vash from .vash to .html for vs2015 syntax highlighting

How do you change the default file extension for Vash? I would like syntax highlighting in Visual Studio 2015, so I want to change the extension from .vash to .html. I read that I should be able to do something like: app.engine("html",…
Hoppe
  • 6,508
  • 17
  • 60
  • 114
0
votes
1 answer

Node.js - How to include a file in a vash template?

I have a Node.js app that uses Express and Vash. I have a layout that looks like this: layout.vash @{ model.items = MyClass.LoadItems(); } MyClass is an ES6 class defined like…
user70192
  • 13,786
  • 51
  • 160
  • 240
0
votes
2 answers

Cannot get vash 0.8.0 to work with express 4.12.3

I am trying to learn node.js. I want to be able to use the vash view engine but for some reason I cannot get it to work. I watched a tutorial on Pluralsight and referenced the vash docs but I keep getting the same error. Here is my…
Michael W Riemer Jr
  • 531
  • 2
  • 8
  • 16
0
votes
2 answers

Vash view engine gives always an error when rendering using nodejs & express 3

I'm using the view engine vash with nodejs & express 3 and my index.vash and layout are looking as follows: // index.vash @html.extend('layout', function(model){ @html.block('body', function(model){ Welcome
Luca Steeb
  • 1,795
  • 4
  • 23
  • 44
0
votes
1 answer

Node.JS Vash TypeError: while rendering template object is not a function

There is another thread that covers this, but I am not allowed to post to it. Also, the only answer does not seem to solve my problem. I am getting the Object not a function error when using the @html.extend() method. I have read all of the very…
1
2