【问题标题】:Best solutions to hide angular2 component in production mode?在生产模式下隐藏 angular2 组件的最佳解决方案?
【发布时间】:2016-10-05 10:12:05
【问题描述】:

我想为“开发”组件创建一条路线并将这条路线锁定在生产模式,但我不知道要这样做。

有人可以在主线中告诉我我该怎么做?

谢谢

【问题讨论】:

标签: testing angular typescript angular2-routing production


【解决方案1】:

您可以使用isDevMode() 函数来测试您是否处于生产模式。 https://angular.io/docs/ts/latest/api/core/index/isDevMode-function.html 在生产模式下,您还可以在路由中使用guard 来阻止。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-04-12
    • 1970-01-01
    • 2020-04-12
    • 2014-09-23
    • 1970-01-01
    • 2011-12-25
    相关资源
    最近更新 更多