如何使用angular cli生成带有延迟加载前缀(+)的文件夹? [英] How to generate folder with Lazy Loading Prefix (+) using angular cli?

查看:82
本文介绍了如何使用angular cli生成带有延迟加载前缀(+)的文件夹?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们开始主要使用 angular-cli 重写 angular 2 应用,以生成组件等.

We began to rewrite our angular 2 app using mainly angular-cli to generate components etc.

现在的问题是,为了遵守《样式指南》,主要组件文件夹(以后可能会延迟加载)应该以"+"为前缀.

The Problem now is, in order to adhere to the Style Guide, major component folders, which later may be loaded lazily should be prefixed with a "+".

使用cli generate指令的--help我可以看到两个选项:

Using --help of the cli generate instruction I could see two options :

--prefix
--route. 

但是将它们设置为true对生成的文件夹名称没有影响.

But setting these to true had no effect on the generated folder name.

我现在的问题是,使用angular-cli生成以"+"为前缀的延迟加载文件夹的正确方法是什么?

My question now is, what is the correct way to generate lazy loaded folders prefixed with a "+" using angular-cli ?

推荐答案

+是在生成路由时自动生成的,当前由于添加新的路由器集成而被禁用.

The + was auto-generated when generating routes which is currently disabled as the new router integration is being added.

话虽如此,由于一些Web服务器对该字符存在问题,因此样式指南可能会更新以删除该建议.

That being said the style guide is likely going to be updated to remove that suggestion as a few web servers are having issues with that character.

这篇关于如何使用angular cli生成带有延迟加载前缀(+)的文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆