在運行angular2應用程序,我得到以下錯誤:Angular2模板渲染錯誤
zone.js:952 GET http://localhost:3000/node_modules/@angular/Forms/ 404 (Not Found)
Error: Fetch error: 404 Not Found
Instantiating http://localhost:3000/node_modules/@angular/Forms
Loading http://localhost:3000/Scripts/module.js
Loading app
at system.src.js:1479
at ZoneDelegate.invoke (zone.js:391)
at Zone.run (zone.js:141)
at zone.js:831
at ZoneDelegate.invokeTask (zone.js:424)
at Zone.runTask (zone.js:191)
at drainMicroTaskQueue (zone.js:595)
at <anonymous>
我已匯入我的模塊文件的FormsModule
,但我依然面臨着同樣的問題。在不斷變化的@angular/Forms
到@angular/forms
,我得到的模板語法錯誤:
Unhandled Promise rejection: Template parse errors:
Parser Error: Unexpected token # at column 1 in [#employee of employees| employeeFilter:query] in ng:///templates/[email protected]:12 ("
<tbody>
<tr [ERROR ->]*ngFor="#employee of employees| employeeFilter:query">
<td>{{employee.userId}}</td>
"): ng:///templates/[email protected]:12
Parser Error: Unexpected token # at column 1 in [#employee of employees| employeeFilter:query] in ng:///templates/[email protected]:12 ("
<tbody>
<tr *ngFor="#employee of employees| employeeFilter:query">
<td>[ERROR ->]{{employee.userId}}</td>
<td>{{employee.firstName}}</td>
<td>{{employee.las"): ng:///templates/[email protected]:16
Parser Error: Unexpected token # at column 1 in [#employee of employees| employeeFilter:query] in ng:///templates/[email protected]:12 ("yee of employees| employeeFilter:query">
<td>{{employee.userId}}</td>
<td>[ERROR ->]{{employee.firstName}}</td>
<td>{{employee.lastName}}</td>
<td>{{employee.F"): ng:///templates/[email protected]:16
Parser Error: Unexpected token # at column 1 in [#employee of employees| employeeFilter:query] in ng:///templates/[email protected]:12 (" <td>{{employee.userId}}</td>
<td>{{employee.firstName}}</td>
<td>[ERROR ->]{{employee.lastName}}</td>
<td>{{employee.FullName}}</td>
<td>{{employee.em"): ng:///templates/[email protected]:16
Parser Error: Unexpected token # at column 1 in [#employee of employees| employeeFilter:query] in ng:///templates/[email protected]:12 (" <td>{{employee.firstName}}</td>
<td>{{employee.lastName}}</td>
<td>[ERROR ->]{{employee.FullName}}</td>
<td>{{employee.employeeCode}}</td>
<td>{{employe"): ng:///templates/[email protected]:16
Parser Error: Unexpected token # at column 1 in [#employee of employees| employeeFilter:query] in ng:///templates/[email protected]:12 (" <td>{{employee.lastName}}</td>
<td>{{employee.FullName}}</td>
<td>[ERROR ->]{{employee.employeeCode}}</td>
<td>{{employee.jobTitle}}</td>
<td>{{employe"): ng:///templates/[email protected]:16
Parser Error: Unexpected token # at column 1 in [#employee of employees| employeeFilter:query] in ng:///templates/[email protected]:12 (" <td>{{employee.FullName}}</td>
<td>{{employee.employeeCode}}</td>
<td>[ERROR ->]{{employee.jobTitle}}</td>
<td>{{employee.emailAddress}}</td>
</tr>
你能用plunkr重現你的問題嗎? https://plnkr.co/並在這裏粘貼你的問題的網址。 – axlj