Skip to main content

angel3_mustache 10.0.0 copy "angel3_mustache: ^10.0.0" to clipboard
angel3_mustache: ^10.0.0 copied to clipboard

A service that renders Mustache template into HTML view for Angel3

Mustache View Template for Angel3 #

Pub Version (including pre-releases) Null Safety Discord License

A service that renders Mustache template into HTML view for Angel3 framework.

Thanks so much @c4wrd for his help with bringing this project to life!

Installation #

In pubspec.yaml:

dependencies:
    angel3_mustache: ^10.0.0

Usage #

const FileSystem fs = LocalFileSystem();

configureServer(Angel app) async {
  // Run the plug-in
  await app.configure(mustache(fs.directory('views')));

  // Render `hello.mustache`
  app.get('/hello', (req, res) => res.render('hello', {'name': 'world'}));
}

Options #

  • partialsPath: A path within the viewsDirectory to search for partials in. Default is ./partials.
  • fileExtension: The file extension to search for. Default is .mustache.

Migrating from 9.x to 10.0.0 #

The breaking changes of each release are listed in the CHANGELOG. Those of 10.0.0 that may need changes in an app:

  • Views: a view name that resolves outside the views directory (../secret, an absolute path, a symbolic link out of it), and a missing view, throw a 404 AngelHttpException, instead of reading the file or throwing a FileSystemException.
  • Partials: a partial that resolves outside the partials directory, or does not exist, renders as nothing, as Mustache specifies.
0
likes
160
points
543
downloads

Documentation

API reference

Publisher

verified publisherdukefirehawk.com

Weekly Downloads

A service that renders Mustache template into HTML view for Angel3

Homepage
Repository (GitHub)
View/report issues
Contributing

License

BSD-3-Clause (license)

Dependencies

angel3_framework, file, mustache_template

More

Packages that depend on angel3_mustache