Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't set attribute bindings on tagless components #39

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions addon/mixins/hook.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ const hookQualifierName = get(config, 'emberHook.hookQualifierName') || 'hookQua
export default Mixin.create({
init() {
this._super(...arguments);

if (this.tagName || this.elementId) {
if (this.tagName !== '') {
let newAttributeBindings = [];
let bindings = get(this, 'attributeBindings');

Expand Down
23 changes: 23 additions & 0 deletions tests/integration/components/tagless-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { moduleForComponent, test } from 'ember-qunit';
import hbs from 'htmlbars-inline-precompile';
import Ember from 'ember';
import {HookMixin} from 'ember-hook';

moduleForComponent('ember-hook', 'Integration | Component | tagless', {
integration: true
});

test('ember-hook does not tag less component', function(assert) {

this.register('component:tag-less', Ember.Component.extend(HookMixin, {
tagName: ''
}));

this.render(hbs`
{{#tag-less}}
template block text
{{/tag-less}}
`);

assert.equal(this.$().text().trim(), 'template block text');
});