After declaring a ponent with selector 'some-p'
, using <some-p></some-p>
in a page will only work once. I would like to use it multiple times any help, here is an example code:
@Component({ selector: 'some-p' })
@View({ template: 'ponent template' })
class SomeComponent { }
bootstrap(SomeComponent);
After declaring a ponent with selector 'some-p'
, using <some-p></some-p>
in a page will only work once. I would like to use it multiple times any help, here is an example code:
@Component({ selector: 'some-p' })
@View({ template: 'ponent template' })
class SomeComponent { }
bootstrap(SomeComponent);
Share
Improve this question
edited Aug 13, 2018 at 4:20
user6749601
asked Jun 12, 2015 at 16:26
Oussama GammoudiOussama Gammoudi
7617 silver badges14 bronze badges
1 Answer
Reset to default 5The bootstrapped Component is really to be looked at as an app, if you want to use the same ponent multiple times, you will want to make it into a directive and then include that directive in your app which you bootstrap.
Look at this menu ponent as an example, you will see the <aria-menuitem>
ponents used multiple times as well as the <aria-menu>
ponents.
https://github./dylanb/Axponents/tree/master/angular2