I
I
Igor Kudryash2017-08-12 13:48:25
Angular
Igor Kudryash, 2017-08-12 13:48:25

Question about layout in Angular 4?

Just started learning angular. It became interesting how you can remove component tags , etc. Vue.js analogy: when you write a component tag, vue replaces that tag with the template of the component itself. Is there something similar in angular, otherwise it is an eyesore when there are such things in the source code<app-root>

<app-root _nghost-c0="" ng-version="4.3.4"><h1 _ngcontent-c0="">Todos</h1>
<ul _ngcontent-c0="">
  ....
</ul>
</app-root>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
lega, 2017-08-13
@ikudryash

Why? Here are the pros for having it:
+ By web component standards, the tag remains
+ When developed / debugged, you can see where which components are (instead of full html)
+ Less problematic (more productive) version of the implementation that works without vdom.
For xs components, for directives in the 1st version there is a tag replacement, but not the fact that it remains in the 4th version.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question