Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lifeart/ember-eval-helper
Ember JS eval helper
https://github.com/lifeart/ember-eval-helper
ember ember-addon ember-eval-helper helpers
Last synced: 10 days ago
JSON representation
Ember JS eval helper
- Host: GitHub
- URL: https://github.com/lifeart/ember-eval-helper
- Owner: lifeart
- License: mit
- Created: 2019-09-18T22:23:31.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-11T06:21:42.000Z (about 2 years ago)
- Last Synced: 2024-11-15T21:45:10.390Z (about 1 month ago)
- Topics: ember, ember-addon, ember-eval-helper, helpers
- Language: JavaScript
- Size: 2.42 MB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 17
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
ember-eval-helper
==============================================================================This addon introduce `e` (eval) helper, to allow this syntax usage in templates:
* this addont don't use `eval`.
```hbs
onclick = window.alert("hello")
```
```hbs
{{#let (e "{ projectName: 'Ember' }") as |project|}}
{{project.projectName}}
{{/let}}{{#each (e "[1,2,3,4]") as |item|}}
Number: {{item}}
{{/each}}
````this` scope access also supported, passing it as second argument
```js
export {
name: "foo"
}
``````hbs
{{e 'this.name' this}}
```Manual `this` context creation:
```hbs
```
Sugar: Angle components tagged values will be autocompiled.
```hbs
// input// output
```
Compatibility
------------------------------------------------------------------------------* Ember.js v2.18 or above
* Ember CLI v2.13 or above
* Node.js v8 or aboveInstallation
------------------------------------------------------------------------------```
ember install ember-eval-helper
```Usage
------------------------------------------------------------------------------```
helper e(evalString = '', context = null)
``````hbs
```Contributing
------------------------------------------------------------------------------See the [Contributing](CONTRIBUTING.md) guide for details.
License
------------------------------------------------------------------------------This project is licensed under the [MIT License](LICENSE.md).