2
我無法來解決這個error
我得到未處理的承諾拒絕:模板解析錯誤:離子3
未處理的承諾拒絕:模板解析錯誤:無法有一個元素 多個模板綁定。僅使用一個屬性 命名爲 '模板' 或*前綴(」
這裏是我的controller
resposeData:any;
public showJobsInitally = false;
employerId = 4; // for testing
this.authService.postData(this.employerId, "jobsPostedByEmployer").then((result)=>{
this.resposeData = result;
console.log(this.resposeData);
}, (err) => {
});
這裏是我的模板:html
<ion-card *ngIf="showJobsInitally" *ngFor="let jobs of resposeData?.postedJobs">
<ion-card-header>
{{jobs?.company_name}}
</ion-card-header>
<ion-card-content>
<p>{{jobs?.skills}}</p>
<p>{{jobs?.package}}</p>
<p>{{jobs?.location}}</p>
<p>{{jobs?.industry}}</p>
<p>{{jobs?.job_type}}</p>
</ion-card-content>
</ion-card>
我
authService
接收這種格式的數據
{"postedJobs":[{"company_name":"Egdhdf","skills":"jdfjfgjgfjfg","package":"jbfjnbgfjfg","location":"gfgghjjghghj","industry":"kghhjghj","job_type":"fjdjgjghhg","expired_or_not":null},{"company_name":"Enigma Brand Solutions","skills":"php,mysql,javascript","package":"3 lakhs","location":"bangalore","industry":"Software","job_type":"permanent","expired_or_not":null}]}