- EmberJS Tutorial
- EmberJS - Home
- EmberJS - Overview
- EmberJS - Installation
- EmberJS - Core Concepts
- Creating and Running Application
- EmberJS - Object Model
- EmberJS - Router
- EmberJS - Templates
- EmberJS - Components
- EmberJS - Models
- EmberJS - Managing Dependencies
- EmberJS - Application Concerns
- EmberJS - Configuring Ember.js
- EmberJS - Ember Inspector
- EmberJS Useful Resources
- EmberJS - Quick Guide
- EmberJS - Useful Resources
- EmberJS - Discussion
EmberJS - Helper Arguments
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" "Tutorialspoint"}} {{outlet}}
Output
Run the ember server; you will receive the following output −
emberjs_template.htm
Advertisements