example
This commit is contained in:
parent
4bc0e7c9cd
commit
b5d83e0a21
5 changed files with 28 additions and 9 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -27,3 +27,4 @@ doc/api/
|
||||||
pubspec.lock
|
pubspec.lock
|
||||||
|
|
||||||
.idea
|
.idea
|
||||||
|
.dart_tool
|
2
CHANGELOG.md
Normal file
2
CHANGELOG.md
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
# 2.0.0
|
||||||
|
* Angel 2 and Dart 2 support.
|
|
@ -13,7 +13,7 @@ In `pubspec.yaml`:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
dependencies:
|
dependencies:
|
||||||
angel_mustache: ^1.1.0
|
angel_mustache: ^2.0.0
|
||||||
```
|
```
|
||||||
|
|
||||||
# Usage
|
# Usage
|
||||||
|
|
16
example/main.dart
Normal file
16
example/main.dart
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
import 'package:angel_framework/angel_framework.dart';
|
||||||
|
import 'package:angel_mustache/angel_mustache.dart';
|
||||||
|
import 'package:file/file.dart';
|
||||||
|
import 'package:file/local.dart';
|
||||||
|
|
||||||
|
const FileSystem fs = const LocalFileSystem();
|
||||||
|
|
||||||
|
configureServer(Angel app) async {
|
||||||
|
// Run the plug-in
|
||||||
|
await app.configure(mustache(fs.directory('views')));
|
||||||
|
|
||||||
|
// Render `hello.mustache`
|
||||||
|
app.get('/', (req, res) async {
|
||||||
|
await res.render('hello', {'name': 'world'});
|
||||||
|
});
|
||||||
|
}
|
14
pubspec.yaml
14
pubspec.yaml
|
@ -2,13 +2,13 @@ name: angel_mustache
|
||||||
description: Mustache view generator for Angel.
|
description: Mustache view generator for Angel.
|
||||||
author: thosakwe <thosakwe@gmail.com>
|
author: thosakwe <thosakwe@gmail.com>
|
||||||
homepage: https://github.com/angel-dart/angel_mustache
|
homepage: https://github.com/angel-dart/angel_mustache
|
||||||
version: 1.1.0
|
version: 2.0.0
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=1.19.0"
|
sdk: ">=2.0.0-dev <3.0.0"
|
||||||
dependencies:
|
dependencies:
|
||||||
angel_framework: "^1.1.0-alpha"
|
angel_framework: ^2.0.0-alpha
|
||||||
file: ^2.0.0
|
file: ^5.0.0
|
||||||
mustache4dart: ">= 1.0.0 < 2.0.0"
|
mustache4dart: ^3.0.0-dev
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
http: ">= 0.11.3 < 0.12.0"
|
http:
|
||||||
test: ">= 0.12.13 < 0.13.0"
|
test:
|
||||||
|
|
Loading…
Reference in a new issue