即使值在浏览器中呈现,我也会收到这些错误。我不知道如何解决这个问题。
错误类型错误:无法读取未定义的属性“长度”
错误类型错误:无法读取未定义的属性“名字”
组件.ts:
teams: Team[];
ngOnInit() {
this.getTeams();
}
constructor(private m: DataManagerService, private router: Router) {
}
getTeams(): void {
this.m.getTeams().subscribe(teams => this.teams = teams);
}
select(em: Team){
this.router.navigate(['/teamView',em._id]);
}
Run Code Online (Sandbox Code Playgroud)
组件.html:
<div class="panel-body">
<table class="table table-striped">
<tr>
<th>Team name</th>
<th>Name of Team Leader</th>
</tr>
<tr *ngFor='let team of teams' (click)="select(team)">
<td>{{team.TeamName}}</td>
<td>{{team.TeamLead.FirstName}} {{team.TeamLead.LastName}}</td>
</tr>
</table>
<hr>
</div>
Run Code Online (Sandbox Code Playgroud)
团队.ts:
export class Team {
_id: string;
TeamName: string;
TeamLead: Employee;
Projects:{};
Employees: {};
}
Run Code Online (Sandbox Code Playgroud)
目的:
数据管理服务.ts
teams: Team[];
projects: Project[]; …Run Code Online (Sandbox Code Playgroud) 我已经将HTTP TCP端口80添加到入站规则中,但我仍然收到错误:
Error: listen EACCES 0.0.0.0:80
at Object._errnoException (util.js:992:11)
at _exceptionWithHostPort (util.js:1014:20)
at Server.setupListenHandle [as _listen2] (net.js:1338:19)
at listenInCluster (net.js:1396:12)
at doListen (net.js:1505:7)
at _combinedTickCallback (internal/process/next_tick.js:141:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
at Function.Module.runMain (module.js:695:11)
at startup (bootstrap_node.js:191:16)
at bootstrap_node.js:612:3
Run Code Online (Sandbox Code Playgroud) 我试图从 Magento2 请求一个简单的 API 搜索,但显然我不能在 URL 请求中使用 % 符号。还有另一种方法可以在 URL 中使用百分号吗?
请求链接:
const request_data = {
url: 'http://.../rest/V1/products?searchCriteria[filter_groups][0][filters][0]'+
'[field]=name&searchCriteria[filter_groups][0][filters][0][value]=%Example%'+
'&searchCriteria[filter_groups][0][filters][0][condition_type]=like',
method: 'GET',
};
Run Code Online (Sandbox Code Playgroud)
控制台错误:
URIError: URI 格式错误
Run Code Online (Sandbox Code Playgroud)at decodeURIComponent (<anonymous>) at OAuth.deParam (/Users/Kevin/Desktop/TestingModules/node_modules/oauth-1.0a/oauth-1.0a.js:227:27) at OAuth.deParamUrl (/Users/Kevin/Desktop/TestingModules/node_modules/oauth-1.0a/oauth-1.0a.js:245:17) at OAuth.getParameterString (/Users/Kevin/Desktop/TestingModules/node_modules/oauth-1.0a/oauth-1.0a.js:142:132) at OAuth.getBaseString (/Users/Kevin/Desktop/TestingModules/node_modules/oauth-1.0a/oauth-1.0a.js:124:130) at OAuth.getSignature (/Users/Kevin/Desktop/TestingModules/node_modules/oauth-1.0a/oauth-1.0a.js:100:36) at OAuth.authorize (/Users/Kevin/Desktop/TestingModules/node_modules/oauth-1.0a/oauth-1.0a.js:87:39) at Object.module.exports.init (/Users/Kevin/Desktop/TestingModules/test.js:36:43) at [eval]:1:19 at ContextifyScript.Script.runInThisContext (vm.js:50:33)