question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Why do I see component tags around component templates??

See original GitHub issue

Hi! Why do I see component tags around component templates?? As result my sidebar dropdown does not work! What cause this problem?

Angular CLI: 1.6.4
Node: 8.2.1
OS: win32 x64
Angular: 5.2.0
... animations, common, compiler, compiler-cli, core, forms
... http, platform-browser, platform-browser-dynamic
... platform-server, router

@angular/cli: 1.6.4
@angular-devkit/build-optimizer: 0.0.37
@angular-devkit/core: 0.0.24
@angular-devkit/schematics: 0.0.45
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.9.4
@schematics/angular: 0.1.12
typescript: 2.4.2
webpack: 3.10.0

image

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:15 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
mlc-mlapiscommented, Jan 16, 2018

@kolkov … because they are custom components which have their own tags. If you use attribute components, directives or <ng-container> (<ng-template>) then they would not be there.

1reaction
mlc-mlapiscommented, Jan 16, 2018

@kolkov … yes, there are some specific cases where you need to avoid of adding custom component tags to DOM (as for example <TABLE><TR><TD> structures) … then so called attribute components take their roles (… <tr myAttributeComponent>...</tr>). Also <ng-container> (<ng-template>) play important roles in many Angular abstraction constructs. You can also use fully programmatic way of creating components … many times combined with dynamic loading of so called lazy loaded modules …

Read more comments on GitHub >

github_iconTop Results From Across the Web

Render content between the component tags - Stack Overflow
I am surprised that this answer got so many upvotes as it shows non-working example. By looking here you will see that ng-content...
Read more >
Using templates and slots - Web Components | MDN
Slots are identified by their name attribute, and allow you to define placeholders in your template that can be filled with any markup...
Read more >
Introduction to components and templates - Angular
A component controls a patch of screen called a view. It consists of a TypeScript class, an HTML template, and a CSS style...
Read more >
Self-closing component tags (<my-comp/> instead of ... - GitHub
The template compiler goes through the template and does a check for each present element to see if it matches with a selector...
Read more >
Components Basics - Vue.js
This is because Vue's template parser respects /> as an indication to end any tag, regardless of its type. In DOM templates, however,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found