1つの要素を示す、記事で満たされた配列があります。
$scope.articles = [];
//New article
var article = {};
article.heading = "A DISCUSSION WITH ATHEISTS ON EVOLUTION";
article.date = "December 24, 2017";
article.description = "The point of my discussion was to attempt to convince a relatively large group of atheists in r/DebateAnAtheist that the theory of evolution which they hold on to so dearly is in fact a random process. It is generally maintained that evolution is not random due to natural selection. This idea, however, is fundamentally flawed.";
article.link = "evolution-debate";
article.img = "templates/articles/evolution-debate/darwin.jpg";
//Add to array
$scope.articles.push(article);
自分の状態を進化論争の状態に変えたい:
.state("evolution-debate", {
url: "/evolution-debate",
templateUrl: "templates/articles/evolution-debate.html",
controller: 'articles'
})
ただし、配列から記事を読み込むため、配列オブジェクトのarticle.linkプロパティを使用して状態を変更する必要があります。
現在このコードを使用していますが、状態は変わりません。
<ul class="actions">
<li><a ng-click="go('{{article.link}}')" class="button big">READ NOW</a></li>
</ul>
どんな助けでもいただければ幸いです。
ui-srefを使用して記事に移動できます
<a ui-sref="{{article.link}}">READ NOW</a>
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加