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

Allows defining multiple compoenents of a specific type on a single e… #1596

Merged
merged 1 commit into from Jul 1, 2016

Conversation

dmarcos
Copy link
Member

@dmarcos dmarcos commented Jun 30, 2016

No description provided.

@@ -290,19 +294,23 @@ var proto = Object.create(ANode.prototype, {

// Check if component already initialized.
if (name in this.components) { return; }
component = this.components[name] = new components[name].Component(this, data);
if (id && !components[name].multiple) {
throw new Error('Trying to initialize multiple components of type ' + name +
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and put backticks around name

@ngokevin
Copy link
Member

I found removeAttribute doesn't detach the component.

@dmarcos dmarcos force-pushed the multipleComponents branch 2 times, most recently from f9eb1cf to fd97cfd Compare July 1, 2016 06:53
var component;
var isComponentDefined = checkComponentDefined(this, name) || data !== undefined;
var componentInfo = attrName.split('__');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably good to make a constant for this.

MULTI_DELIMITER = '__';

@ngokevin
Copy link
Member

ngokevin commented Jul 1, 2016

Add test for getComputedAttribute for multi

r+wc

@dmarcos dmarcos merged commit 380e4d2 into aframevr:master Jul 1, 2016
@ngokevin
Copy link
Member

ngokevin commented Jul 1, 2016

nice

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants