我有以下SQL
SELECT articles.id, articles.title, tags.name AS tags
FROM articles
LEFT JOIN article_tag_association ON articles.id = article_tag_association.article_id
LEFT JOIN tags ON tags.id = article_tag_association.tag_id
Run Code Online (Sandbox Code Playgroud)
这可以正常工作,除了它为文章所拥有的每个标签创建一行,其中包含限制
例如
[
"0" => ["id" => "1", "title" => "test", "tags" => "tag1"],
"1" => ["id" => "1", "title" => "test", "tags" => "tag2"],
"2" => ["id" => "2", "title" => "test2", "tags" => "tag1"],
]
Run Code Online (Sandbox Code Playgroud)
(只有2篇文章,但有3行)
有没有办法让它用一系列标签返回每篇文章?
就像是:
[
"0" => ["id" => "1", "title" => "test", "tags" => ["tag1", "tag2"]],
"1" => ["id" => …Run Code Online (Sandbox Code Playgroud) 在Angular 1中使用ng-bind可以提高插值性能.
Angular 2中的情况仍然如此吗?我应该使用[innerText]过插值.
例如
<p>{{slower}}</p>
<p [innerText]="faster"></p>
Run Code Online (Sandbox Code Playgroud)