【发布时间】:2017-10-29 15:57:11
【问题描述】:
我想在 Angular 2 中实现一个静态数组,与 PHP 中的这个数组等效。我该怎么做?
<?php
class Services
{
const TaskPoll = "TaskPoll";
const ModuleList = "ModuleList";
public static $services = array
(
Services::TaskPoll =>array("APIURL"=>"task/poll","APIRequestType"=>"PostAPI","RestService"=>["WarName"=>"abc","ServiceUrl"=>"http://localhost:8080"]),
Services::ModuleList =>array("APIURL"=>"task/modulelist","APIRequestType"=>"GetAPI","RestService"=>["WarName"=>"abc","ServiceUrl"=>"http://localhost:8080"]),
);
}
【问题讨论】:
-
为什么要在
PHP和Angualr 2中编写代码?我的意思是上面的代码 -
@Mr_Perfect 我需要在 Angular 2 中移植相同的代码。这就是原因
标签: php arrays angular static constants