Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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 above

Installation
------------------------------------------------------------------------------

```
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).