【问题标题】:How to define a private constant variable in Angular 2+ components如何在 Angular 2+ 组件中定义私有常量变量
【发布时间】:2019-09-07 10:59:58
【问题描述】:

我们在组件本身中是否有类似私有静态变量的东西。不像 Global Constants ,而是类(组件)本身私有的东西。

【问题讨论】:

  • 你是说私有财产?类似private address: string = 'xxxx'?

标签: angular constants angular-components private-members class-constants


【解决方案1】:

你需要private readonly constant = 'constant';

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-08-29
    • 2017-01-04
    • 2020-11-27
    • 2016-07-16
    • 1970-01-01
    • 1970-01-01
    • 2016-07-28
    • 2017-04-09
    相关资源
    最近更新 更多