jmurphyau / ember-get-helper Goto Github PK
View Code? Open in Web Editor NEWEmber Get Helper for HTMLBars
License: MIT License
Ember Get Helper for HTMLBars
License: MIT License
I'm hitting the issue fixed in 8596972
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]
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.
the helper registration seems to not be working properly now, I am on ember 1.13.10
related to this PR #16
I'm currently using this helper roughly like this:
Unfortunately this only works once the index
is above zero, but not for the first element.
It looks like https://github.com/jmurphyau/ember-get-helper/blob/master/addon/helpers/get-glimmer.js#L25 is responsible. Changing the line to if (!Ember.isNone(path)) {
seems to fix the problem.
Hi @jmurphyau !
Awesome addon! Do you have a solution to play with it on http://emberjs.jsbin.com/ ?
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.
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])}}
...
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.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.