2
I have this html body that will invert the boolean variable d.expandedBlog
when clicked. It is working normally.
<div class="article-blog-icon-comment">
<i class="fa fa-commenting-o article-blog-menu-topbar"
ng-click="d.expandedBlog = !d.expandedBlog" pr-expand-article="d.article.uid"
expandedBlog="d.expandedBlog"></i>
</div>
But now I want the same html body to also invert the variable d.expanded
.
I tried to do it that way:
<div class="article-blog-icon-comment">
<i class="fa fa-commenting-o article-blog-menu-topbar"
ng-click="d.expandedBlog = !d.expandedBlog, d.expanded = !d.expanded"
pr-expand-article="d.article.uid"
expandedBlog="d.expandedBlog" expanded="d.expanded"></i>
</div>
But it is giving syntax error, I do not know the syntax to do this kind of thing. What could be done here?
+1! It may be valid to comment on which expressions
ng-click
are normally interpreted by the Angularjs parser, which is why you can create discrete sequences of expressions. I also agree that a role would be the best place to aggregate these actions.– OnoSendai