执行代码片段,类似eval。使用Function包装。
Parameters
-
text
String需要执行的代码片段
-
bind
Object代码片段中this的指向
-
arg
Object传入参数。如:{x:1, y:'5'},在代码片段中可使用 x 和 y 变量。
-
throwError
boolean当代码片段运行错误时,是否抛出错误
Returns
-
any返回执行的代码片段的返回值
Source
Parameters
-
name
String要调用的服务名称
-
data
Object调用的服务的请求数据
Returns
-
promise调用结果
Source
Parameters
-
text
String需要执行的代码片段
-
bind
Object代码片段中this的指向
-
arg
Object传入参数。如:{x:1, y:'5'},在代码片段中可使用 x 和 y 变量。
-
throwError
boolean当代码片段运行错误时,是否抛出错误
Returns
-
any返回执行的代码片段的返回值