这是我的形象 我想在图像中给出的onclick函数中传递“c.name”和“c.image_Url”
答案 0 :(得分:1)
$documents = $collection->find([ //conditions here ]);
// iterate through each row/document
foreach ($documents as $document) {
//grab the keyword
$keyword = $document['keyword'];
// make an API request
$AdditionalData = APIRequest($keyword, $arguments);
// store fetched data in another collection
$anotherCollection->insert($AdditionalData);
}
在组件中,
<div *ngFor="let c of categories" (click)="selectedCategory(c.name,c.image_url)">
//<---note (click) event - angular2 way element's click binding
....
</div>