Coder Social home page Coder Social logo

ember-get-helper's People

Contributors

dremora avatar dschmidt avatar essmd avatar jmurphyau avatar odoe avatar rwjblue avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ember-get-helper's Issues

deprecation warning when using ember 1.13.9

The following deprecation warning is shown when using ember 1.13.9:

DEPRECATION: Using Ember.HTMLBars._registerHelper is deprecated. Helpers (even dashless ones) are automatically resolved. [deprecation id: ember-htmlbars.register-helper]

[Proposal] get function

I don't know if it possible, but it would be great to have a functionality like this.

// columns definition
columns: [
  {name: 'Name', property: 'name'},,
  {name: 'Salary of an employee', property: 'name', format: function(value){
    return parseFloat(value).toFixed(2);
  }}
]

// in a table component 
  {{#each model as |row|}}
  <tr>
    {{#each columns as |column|}}
      {{#if column.format}}
        <td>{{get column.format( row column.component) }}</td>
      {{else}}
        <td>{{get row column.property}}</td>
      {{/if}}
    {{/each}}
  </tr>
  {{/each}}

Alternative syntax:

  {{get column.format( row[column.component])}}
  ...

Using helper to set two-way binding

Hello everyone,
I am using the ember-get-helper add-on, on Ember 1.13.7, to create my own dynamic table component.
In the component, I created a columnFilter object which will have a key for each table column, and will be dynamically filled once the relative filter input text is edited.
Therefore, my HTMLbars template looks like this:

{{#each contentColumns as |column|}}

{{input type="search" placeholder=(t 'table.filter') value=(get columnFilters column.name)}} {{/each}}

Now, the (get) helper has no problem fetching the value if I fill it beforehand, but upon editing the value in the input field, there is no two-way binding, since the columnFilters object does NOT get updated.
Is this an expected behavior? Should I go another way to have dynamic bindings, or is this a known bug?
Thank you in advance.

Act as a polyfill

I think this project should behave a bit differently regarding ember versions.
We should follow ember-new-computed's example and behave like:

For versions prior to 1.12.0-beta.1 this addon will allow usage of the new syntax by polyfilling but as of Ember 1.12.0-beta.1 a polyfill is not needed and the internal implementation of Ember.computed is used.

This is extremely useful for addon developers that want to use the get helper in their addons but still want to maintain the compatibility with Ember 1.13 users.

Wrong deprecation warning using Ember 1.13.10

With Ember 1.13.10, the helper beeing used is the glimmerHelper, but it throws this deprecation warning:

DEPRECATION: ember-get-helper has been included in Ember 2.0. Use of this package is deprecated

I wonder if this message could just be removed.
Unless I'm missing something, this commit the addon will just be a no op in 2.0, so the message would not be displayed anyway.

Deprecation in Ember 2.x

When this addon is used with Ember 2.x there will be a deprecation cause in the init method:

DEPRECATION: Overriding init without calling this._super is deprecated. Please call 'this._super.init && this._super.init.apply(this, arguments);' addon: ember-get-helper

I know this addon is no longer maintained since the get helper is included in Ember 2.x and its only loaded in when ember version < 2.x but the addons "init" method is always called. Also when using Ember 2.x.

This simple super call would fix the deprecation warning:
this._super.init && this._super.init.apply(this, arguments);

Thanks in advance.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.