Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Handlebars error: Could not find property 'query-params' although Feature activated

I am trying to use query-params in my route / controller but the handlebars helper is causing this error:

Uncaught Error: <(subclass of Ember._MetamorphView):ember689> Handlebars error: Could not find property 'query-params' on object .

This error is caused by this link to helper:

{{#link-to 'betround.stats' (query-params game=id) }}
            <li {{bind-attr class="isPast:small"}}> {{team1}} {{scoreT1}} : {{scoreT2}} {{team2}} (gameid: {{id}})</li>
{{/link-to }}

I have already upgraded Ember and Handlebars

DEBUG: Ember      : 1.4.0-beta.4
DEBUG: Ember Data : 1.0.0-beta.4
DEBUG: Handlebars : 1.3.0
DEBUG: jQuery     : 2.0.3 

As well as enabled the query-params-new feature:

    <script type="text/javascript">
        ENV = {FEATURES: {'query-params-new': true}};
    </script>
    <script src="bower_components/jquery/jquery.js"></script>
    <script src="bower_components/handlebars/handlebars.js"></script>
    <script src="bower_components/underscore/underscore.js"></script>
    <script src="bower_components/ember/ember.js"></script>
    <script src="bower_components/ember-animated-outlet/ember-animated-outlet.js"></script>
    <script src="bower_components/ember-data/ember-data.js"></script>

I am not sure if it is relevant but this is also my controller for the route:

GambifyApp.BetroundStatsController = Ember.ArrayController.extend({
    needs: "betround",
    queryParams: ['game'],
    game: null,

    filteredBets: function() {
        var game= this.get('game');
        var bets = this.get('model');

        if (game) {
            return articles.filterProperty('game', game);
        } else {
            return articles;
        }
    }.property('category', 'model')
});
like image 458
m0c Avatar asked Feb 01 '14 19:02

m0c


2 Answers

It's a bug in that version of Ember, it's working in canary versions.

http://emberjs.jsbin.com/ucanam/3566/edit

like image 197
Kingpin2k Avatar answered Nov 07 '22 16:11

Kingpin2k


They put in query-params-new by accident in v1.4.0-beta3, and removed it as of v1.4.0-beta4. The release version of 1.4.0 does not have this feature, as well as the beta versions of 1.5.0.

It looks like if you wanted to keep working with query-params-new, you'll either need to use the canary build (1.6.0) or revert to 1.4.0-beta3.

https://github.com/emberjs/ember.js/issues/4372#issuecomment-35175856

like image 29
iam3v4n Avatar answered Nov 07 '22 16:11

iam3v4n