Questions tagged [htmlbars]

HTMLBars is the EmberJS templating system replacement for Handlebars starting with v1.10.0

HTMLBars is the templating system replacement for starting with v1.10.0. You can check the source code here.

116 questions
31
votes
9 answers

Combine linkTo and action helpers in Ember.js

I need to combine linkTo and action helpers in Ember.js. My code is: {{#link-to 'index'}}Clear{{/link-to}} But I would like to make this something like this: {{#link-to 'index' {{action 'clear'}}…
Daniel Kmak
  • 18,164
  • 7
  • 66
  • 89
25
votes
1 answer

Conditional class in HtmlBars

In regular handlebars I was able to do:
How can I do this in Htmlbars? I tried this but it didn't work.
jax
  • 37,735
  • 57
  • 182
  • 278
17
votes
2 answers

How can I yield multiple pieces of content into an ember.js component template?

The goal is to define a structure of HTML that has more than one block of content that is declared by the caller. For example, a header, body, and content. The resulting markup should be:
My header
My…
aceofspades
  • 7,568
  • 1
  • 35
  • 48
13
votes
4 answers

Ember Component Integration Tests: `link-to` href empty

I'm trying to write a component integration test, a la this blog post, but my component has a link-to to a dynamic route and the href property isn't being filled in. Here is a simplified version of what I'm trying to do. My component's…
Joshua Conner
  • 882
  • 8
  • 21
11
votes
4 answers

Pass a reference of the clicked DOM element to the action handler in Ember

I have a set of buttons whose state I wish to toggle with a class active. If I had a single button, then I would bind the active class to a controller property and toggle that property in the click handler:
10
votes
2 answers

How to enforce Ember.Component to rerender?

Is there any way to make Ember.Component force rerender? There is .rerender() method, but it doesn't help. Also I tried use .notifyPropertyChange for template, layoute - the same Right now for such cases I need to wrap piece of template into if…
Vasiliy vvscode Vanchuk
  • 7,007
  • 2
  • 21
  • 44
6
votes
4 answers

How to write Helpers in HTMLBars?

After the latest release of EmberJS v1.9.0 I am trying to move from Handlebars to HTMLbars. What I am finding very challenging is lack of documentation. I am trying to implement very simple helpers. For example take this handlebars…
Sisir
  • 2,668
  • 6
  • 47
  • 82
5
votes
2 answers

Ember.js dynamic components

I have two Models Admin and User My application template is as follow //application.hbs {{outlet}} {{header-nav}} What I want to do (if it is possible) to make {{header-nav}} customizable, I explain : If the admin authenticate I want to render…
Grimmy
  • 143
  • 1
  • 9
5
votes
1 answer

Compile template client side in ember using HTMLbars

I have created a CMS where it is be possible to use HTMLbars to create templates. The templates should be compiled client side and there is component that should display the template. I'm setting the template property of the component to a function…
Lillvik
  • 385
  • 4
  • 20
4
votes
2 answers

How to change input helper's class based on some condition in Ember

How can the if condition clause be used in an input helper. I tried: {{input class="{{if errors.name "style-error"}}" }} It caused building error. the errors.name here is property from controller. I reckon that it is the nested double curly braces…
glenlivet1986
  • 260
  • 3
  • 12
4
votes
1 answer

Access a hash with a dynamic variable - getting Parse error Expecting 'ID', got 'INVALID'

I have a hash in my route defined as: model: function() { return Ember.RSVP.hash({ signedServices: { lyft: false, uber: false, postmates: false, doordash: false, caviar: false } }); }, In my handlebar view,…
Huy
  • 10,806
  • 13
  • 55
  • 99
4
votes
1 answer

How to fix the deprecated Ember.Handlebars.registerBoundHelper in Ember 1.13.9?

I am currently upgrading from Ember 1.8.1 to Ember 1.13.9. My App is sort of oldschool by NOT using the ember-cli (no es6 whatever syntax). How do i replace the deprecated Ember.Handlebars.registerBoundHelper…
justastefan
  • 595
  • 5
  • 18
4
votes
1 answer

Binding static and dynamic classes with HTMLBars

I'm trying to bind a static class 'form-control' and a dynamic property value 'color' to the class attribute of an input helper, however, the syntax I'm using just outputs this to the rendered DOM element class="form-control {{color}}" without…
user2637236
3
votes
0 answers

How to resolve ember cli problems when the issue appears to reside in a plugin from node_module?

I am running into this problem when running ember scripts The plugin…
user2167582
  • 5,986
  • 13
  • 64
  • 121
3
votes
2 answers

How to display error message in ember js 2.0

I would like to display an error message when the server responses with record not found. The model in the route handler: model: function(userLoginToken) { var userLoginToken= this.store.createRecord('userLoginToken'); return…
1
2 3 4 5 6 7 8