Skip to content
This repository has been archived by the owner on Feb 21, 2024. It is now read-only.

BBVAEngineering/ember-bind-helper

 
 

Repository files navigation

DEPRECATED

Ember Bind Helper

CircleCI

This addon provides a bind helper to bind a function to a context.

Installation

ember install ember-bind-helper

Using bind

Let's say we want to call a method of an object when we click a function. We might think of doing the following:

<button onclick={{action myObject.myMethod}}>
  My Button
</button>

Sadly, this might not work as expected, given that the context would be the controller (twiddle). To solve this, you can use the bind helper:

<button onclick={{action (bind myObject.myMethod myObject)}}>
  My Button
</button>

About

Add a bind helper to bind a function to a context

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 83.9%
  • HTML 16.1%