我在常量中有一个正则表达式:
export const Constants = {
QUERY_PARAM_CONFIG: {
REGEX: /\+/gi,
REGEX_ENCODED: /%2B/g
}
};
但是当我运行ng build时,出现了错误:
ERROR in app\app.module.ts(58,21): Error during template compile of 'AppModule'
Expression form not supported in 'Constants'
'Constants' contains the error at app\configuration\constants.ts.
npm构建脚本:
ng build --prod --output-hashing none --sourcemaps=true
有什么想法吗?
ng build
vs.ng build --prod
)。 - Pavel Agarkov