X Tutup
Skip to content

PrivateComponent & Shadow DOM #1077

@vicb

Description

@vicb

@vsavkin I'm not sure how dynamic components are supposed to work but IMO they should honor <content> tags, don't they ?

If this is how they are supposed to work and we get this to work there might be a follow up issue: in scoped shadow DOM mode, the class on the component tag must be set according to the (loaded) component UID for the CSS shim to work. It seems like this is not done right now

With the following code

import {bootstrap, DynamicComponent, Component, Decorator, Template, NgElement} from 'angular2/angular2';

import {Injectable} from 'angular2/di';

import {PrivateComponentLoader} from 'angular2/src/core/compiler/private_component_loader';
import {PrivateComponentLocation} from 'angular2/src/core/compiler/private_component_location';

@Component({
  selector: 'hello-app'
})
@Template({
  inline: `
    <dyn>D1</dyn>
    <dyn>D2</dyn>
    <stat>S1</stat>
    <stat>S2</stat>`,
  directives: [Dyn, Stat]
})
class HelloCmp {
}

@DynamicComponent({
  selector: 'dyn'
})
class Dyn {
  constructor(loader: PrivateComponentLoader, location: PrivateComponentLocation) {
    loader.load(Stat, location)
  }
}

@Component({
  selector: 'stat'
})
@Template({
  inline: '<p>Static Component [<content></content>]</p>'
})
class Stat {

}

export function main() {
  bootstrap(HelloCmp);
}

I expect the output to be

Static Component [D1]
Static Component [D2]
Static Component [S1]
Static Component [S2]

but it is

Static Component []
Static Component []
Static Component [S1]
Static Component [S2]

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions

    X Tutup