Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use templates with TypeScript? #44

Closed
daslicht opened this issue Nov 17, 2016 · 4 comments
Closed

How to use templates with TypeScript? #44

daslicht opened this issue Nov 17, 2016 · 4 comments

Comments

@daslicht
Copy link

daslicht commented Nov 17, 2016

How to import nunjucks templates using the es6 syntax , please?

eg this one : var tpl = require('./views/page.njk');

@daslicht
Copy link
Author

daslicht commented Nov 17, 2016

import * as tpl from './views/page.njk'

@at0g
Copy link
Owner

at0g commented Nov 21, 2016

import tpl from './views/page.njk';

const result = tpl.render({ message: 'hello es6' });

^ Bit off topic - how to use ES6 import syntax is not really an issue of this project

@at0g at0g closed this as completed Nov 21, 2016
@daslicht
Copy link
Author

Thank you for answering that illegal question anyway....

@daslicht
Copy link
Author

daslicht commented Apr 2, 2017

Long time not tried but today again :

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants