<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>kasaharu</author_name>
  <author_url>https://blog.hatena.ne.jp/kasaharu/</author_url>
  <blog_title>とんかつ時々あんどーなつ</blog_title>
  <blog_url>https://kasaharu.hatenablog.com/</blog_url>
  <categories>
    <anon>Angular</anon>
  </categories>
  <description>はじめに Angular のテンプレートは @if や @switch といった制御フローブロックがサポートされているため、条件に応じた表示の切り替えが簡単に実現できる。 一方で、これらは多用するとテンプレートファイルの肥大化にもつながる。 このようなとき component を分割する方法が真っ先に上げられるが、component を分割しないまま、テンプレートフラグメントによる可読性の向上も選択肢として有用なので紹介する。 テンプレートフラグメント テンプレートフラグメントは &lt;ng-template&gt; 要素を使って動的に表示できるコンテンツを指す。 &lt;p&gt;Hello&lt;/p&gt; &lt;ng-te…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fkasaharu.hatenablog.com%2Fentry%2F20250127%2F1737989832&quot; title=&quot;Angular のテンプレートを同一コンポーネント内で分割するときはフラグメントが便利 - とんかつ時々あんどーなつ&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2025-01-27 23:57:12</published>
  <title>Angular のテンプレートを同一コンポーネント内で分割するときはフラグメントが便利</title>
  <type>rich</type>
  <url>https://kasaharu.hatenablog.com/entry/20250127/1737989832</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
