{"id":14986785,"url":"https://github.com/thefrontside/ember-let","last_synced_at":"2025-07-23T15:04:37.659Z","repository":{"id":57120396,"uuid":"63244628","full_name":"thefrontside/ember-let","owner":"thefrontside","description":"Create variable bindings inside your handlebars templates","archived":false,"fork":false,"pushed_at":"2018-11-07T15:06:49.000Z","size":145,"stargazers_count":52,"open_issues_count":11,"forks_count":16,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-06-13T14:57:36.313Z","etag":null,"topics":["binding","ember","ember-addon","emberjs","functional-programming","handlebars","javascript"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thefrontside.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-07-13T12:38:49.000Z","updated_at":"2024-05-30T02:24:33.000Z","dependencies_parsed_at":"2022-08-23T07:50:18.016Z","dependency_job_id":null,"html_url":"https://github.com/thefrontside/ember-let","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/thefrontside/ember-let","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thefrontside%2Fember-let","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thefrontside%2Fember-let/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thefrontside%2Fember-let/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thefrontside%2Fember-let/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thefrontside","download_url":"https://codeload.github.com/thefrontside/ember-let/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thefrontside%2Fember-let/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265407221,"owners_count":23760036,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["binding","ember","ember-addon","emberjs","functional-programming","handlebars","javascript"],"created_at":"2024-09-24T14:13:32.976Z","updated_at":"2025-07-23T15:04:37.627Z","avatar_url":"https://github.com/thefrontside.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ember-let\n\n[![npm version](https://badge.fury.io/js/ember-let.svg)](https://badge.fury.io/js/ember-let)\n[![Ember Observer Score](https://emberobserver.com/badges/ember-let.svg)](https://emberobserver.com/addons/ember-let)\n[![Build Status](https://travis-ci.org/thefrontside/ember-let.svg?branch=master)](https://travis-ci.org/thefrontside/ember-let)\n\n\n`ember-let` is an addon for binding variables to template contexts in Ember. It behaves much like the `with` helper, but lets you bind an arbitrary number of variables, including standalone values, hashes, and class instances. However, unlike `with`, the `let` helper will yield its block even if the bound values are `undefined`, `null`, or `[]`. This has the benefit of allowing the user to treat the block values as true variable bindings rather than simply aliases to existing values.\n\nSee examples below:\n\n**Bind basic values**\n```hbs\n{{#let \"abc\" \"123\" as |first second|}}\n  \u003cli\u003e{{first}}\u003c/li\u003e\n  \u003cli\u003e{{second}}\u003c/li\u003e\n{{/let}}\n```\n\n**Mix hashes and standalone values**\n```hbs\n{{#let (hash first=\"first\" second=\"second\") \"third\" as |hash standalone|}}\n  \u003cli\u003e{{hash.first}}\u003c/li\u003e\n  \u003cli\u003e{{hash.second}}\u003c/li\u003e\n  \u003cli\u003e{{standalone}}\u003c/li\u003e\n{{/let}}\n```\n\n**Bind a class instance returned from a helper**\n```hbs\n{{#let (boolean) as |bool|}}\n  {{bool.value}} - \u003cbutton onClick={{action bool.toggle}}\u003etoggle\u003c/button\u003e\n{{/let}}\n```\n\n**Inline use**\nNote: requires Ember 2.0+ (ie. does not support 1.13)\n\n```hbs\n{{let greeting=(concat \"hello \" to)}}\n{{greeting}} - \u003cbutton {{action (action (mut to) \"world\")}}\u003eGreet the world!\u003c/button\u003e  \n```\n\nInline let declarations are in scope until the parent element or block is closed, for example:\n\n```hbs\n{{#if person.isActive}}\n  \u003cdiv\u003e\n    {{let name=person.name}}\n    \u003cspan\u003e{{name}}\u003c/span\u003e\n  \u003c/div\u003e\n  {{!-- The name binding is not accessible here... --}}\n{{/if}}\n{{!-- ...or here. -- }}\n```\n\n## Installation\n\n* `git clone` this repository\n* `npm install`\n* `bower install`\n\n## Running\n\n* `ember server`\n* Visit your app at http://localhost:4200.\n\n## Running Tests\n\n* `npm test` (Runs `ember try:testall` to test your addon against multiple Ember versions)\n* `ember test`\n* `ember test --server`\n\n## Building\n\n* `ember build`\n\nFor more information on using ember-cli, visit [http://ember-cli.com/](http://ember-cli.com/).\n\n## Code of Conduct\nPlease note that this project is released with a Contributor Code of\nConduct. By participating in this project you agree to abide by its\nterms, which can be found in the `CODE_OF_CONDUCT.md` file in this\nrepository.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthefrontside%2Fember-let","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthefrontside%2Fember-let","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthefrontside%2Fember-let/lists"}