EmberJS – Helper Arguments

  • Post author:
  • Post category:EmberJS
  • Post comments:1 Comment
argument

You can pass more than one argument to the helper by specifying after the helper name.

Syntax

export default Ember.Helper.helper(function(params) {
   //code here
}

Example

The example given below passes the multiple arguments to the helper. Create a new helper as helperarguments and add the following code to it −

import Ember from 'ember';

export default Ember.Helper.helper(function(params) {
   let [arg1, arg2] = params;
   document.write("Text is : " +arg1+ ''+arg2);
});

Open the index.hbs file and write the following code −

{{helperarguments "Welcome to" "Adglob"}}
{{outlet}}

Previous Page:-Click Here

This Post Has One Comment

Leave a Reply