Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/johno/ember-dynamic-render
[DEPRECATED] No longer under development as Ember now has a `component` helper.
https://github.com/johno/ember-dynamic-render
Last synced: 2 months ago
JSON representation
[DEPRECATED] No longer under development as Ember now has a `component` helper.
- Host: GitHub
- URL: https://github.com/johno/ember-dynamic-render
- Owner: johno
- License: mit
- Created: 2014-11-13T01:32:01.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2015-01-27T07:11:17.000Z (almost 10 years ago)
- Last Synced: 2024-10-19T17:49:44.281Z (3 months ago)
- Language: JavaScript
- Homepage:
- Size: 156 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Dynamic Render
_Currently under development, and is intended to be a PoC._
This is an [ember-cli](http://www.ember-cli.com/) addon for dynamic rendering. This is intended
to allow templates to be rendered based off of variables, objects, and arrays similar to Rails
functionality.### Proposed API
###### Array rendering
```hbs
{{dynamic-render foos}} {{! render 'foo' foo for each object inferred by model name.}}
```###### Object rendering
```hbs
{{dynamic-render bar}} {{! render 'bar' bar for the object inferred by model name.}}
```###### Rendering from a variable
```hbs
{{dynamic-render myVariable}} {{! render 'myVariableValue' }}
```## Installation
```
npm i --save-dev ember-dynamic-render
```## Usage
This allows you to specify dynamic templates to render:
```hbs
{{dynamic-render someVariable object }}
```It will also infer the template if one isn't specified by the model name:
```hbs
{{dynamic-render object}} {{! # => will render object.hbs }}
```## Development
### Installation
* `git clone` this repository
* `npm install`
* `bower install`### Running
* `ember server`
* Visit your app at http://localhost:4200.### Running Tests
* `ember test`
* `ember test --server`### Building
* `ember build`
## Acknowledgements
Adapted from .
## License
MIT
## Contributing
1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull RequestCrafted with <3 by [John Otander](http://johnotander.com) ([@4lpine](https://twitter.com/4lpine)).