Quantcast
Channel: Ember.JS - Latest topics
Viewing all articles
Browse latest Browse all 4831

Ember CLI - How to use a util function in a template helper function?

$
0
0

@fknoll wrote:

What am I doing wrong here?

  • I define a util function isXDefactoEqualY.
  • I use this util function to define a template helper isXEqualY.
  • When using this template helper in a specific template, then this template is NOT rendered.
  • I see no compilation errors.
  • I see no errors in console.

app/utils/is-x-defacto-equal-y.js

import Ember from 'ember';

export default function ([model, list]) {
    ... code
    return true;
}

app/helpers/is-x-equal-y.js

import Ember from 'ember';
import isXDefactoEqualY from '../utils/is-x-defacto-equal-y';

export function isXEqualY([model, list]) {
    return isXDefactoEqualY (model, list);
}

export default Ember.Helper.helper(isXEqualY);

app/templates/x.hbs

<div>isXEqualY: {{isXEqualY myModel myList}}</div>

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4831

Trending Articles