ng-init値に基づいて部分的なhtmlファイルのスタイルを非表示、表示、または変更しようとしています。ng-init変数に基づいてng-include部分HTMLテンプレートの側面を表示または非表示しようとしています
私の部分がある:私のメインのHTMLページに
<article class="preview {{size}}" ng-if="desktop">
<a class="cover absolute" style="background-image:url(/images/samples/sample-image.jpg);">
<div class="post-info absolute full-width padding">
<h2 ng-if="artist" class="text-center">band name</h2>
<h3 class="post-title section-spacer" ng-if="!artist">title of news artcle <span>2hrs</span></h3>
<p ng-if="caption==true; !artist" class="post-caption">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud</p>
</div>
<div class="post-preview-gradient"></div>
</a>
</article>
、私は、このセットアップを持っている:artist = false
かのよう
<div class="row push-to-11 small-up-1 medium-up-2 large-up-3 section-spacer-large">
<div class="column" ng-init="size='threequart-padding-bottom'; artist = true; " ng-include="'/partials/elements/posts/post-preview-regular.html'"></div>
<div class="column" ng-init="size='threequart-padding-bottom'; artist = false; " ng-include="'/partials/elements/posts/post-preview-regular.html'"></div>
</div>
彼らは両方の現在の属性を取得しています。
いつでも、いつng-initを使用しないかについて、複数の記事を読んでいますが、これはなぜ各divで更新されないのか混乱しています。私はこの部分を複数のページで使用しています。