jmurphyau/ember-truth-helpers

Getting started...

philmbst opened this issue · 4 comments

Hey!

I'm fairly new to ember and I'm struggling to get this working.

I have ran ember install ember-truth-helpers which worked but when using any of the helpers I get Handlebars error: Could not find property 'gt' on object in the console?

I suspect something went wrong with the install or perhaps you're invoking it incorrectly. Would you mind posting your package.json and maybe a snippet of you using the gt helper in a template.

Cheers for the reply man!

package.json

{
  "name": "***",
  "version": "0.0.694",
  "description": "",
  "main": "app.js",
  "scripts": {
    "test": ""
  },
  "author": "***",
  "license": "ISC",
  "devDependencies": {
    "bower": "^1.5.2",
    "del": "^1.2.1",
    "ember-truth-helpers": "1.2.0",
    "gulp": "^3.9.0",
    "gulp-autoprefixer": "^2.3.1",
    "gulp-bower": "0.0.10",
    "gulp-bump": "^0.2.2",
    "gulp-concat": "^2.4.3",
    "gulp-copy": "0.0.2",
    "gulp-ember-templates": "^0.6.0",
    "gulp-es6-module-transpiler": "^0.2.2",
    "gulp-git": "^1.4.0",
    "gulp-if": "^1.2.5",
    "gulp-jasmine": "^2.0.1",
    "gulp-rename": "^1.2.2",
    "gulp-replace": "^0.5.4",
    "gulp-sass": "^2.0.4",
    "gulp-shell": "^0.3.0",
    "gulp-sourcemaps": "^1.5.2",
    "handlebars": "2.0.0",
    "http-server": "^0.7.5",
    "jasmine-reporters": "^2.0.6",
    "main-bower-files": "^2.9.0",
    "run-sequence": "^1.1.4",
    "selenium-standalone": "^4.4.2",
    "webdriverio": "^2.4.5",
    "yargs": "^3.25.0"
  },
  "dependencies": {}
}

usage

{{#if (gt view.content.length 1)}}
  yay
  {{else}}
  nay
  {{/if}}

Cheers :)

What Ember version are you using this with?

One thing that stands out to me is that in your package.json I see a lot of gulp and very little Ember CLI. But you also stated that you ran ember install ember-truth-helpers.

Are you trying to use Gulp instead of Ember CLI? If so, that is definitely the problem here. I've heard of people using Gulp, I've never used it so I can't really help. But if you're new to Ember I would really really recommend using Ember CLI. Most of the addons you'll find, like this one, require Ember CLI.

The TL;DR; is that Ember CLI will traverse that packages, pick up all ember addons, process them and load them into the application space. It seems like in this case the Ember runtime is unable to find the gt helper. Likely because it's not being picked up by the Gulp buildtools.