generate命令需要在Angular项目中运行吗? [英] The generate command requires to be run in an Angular project?

查看:68
本文介绍了generate命令需要在Angular项目中运行吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道为什么尽管我在项目中安装了Angular CLI,但每次尝试在angular项目中添加组件时都会收到此类消息.

I'm wondering why I am getting this kind of message whenever I try to add a component in my angular project although I have Angular CLI installed in my project.

推荐答案

据我所知,ionic 3不会创建angular.json,这就是我想要创建例如pipe时要寻找的角度

As far as i know does ionic 3 dont create a angular.json, and that's what angular i looking for when you want to create for example a pipe.

如果要在离子3中创建pipe,只需运行ionic g pipe myPipe.

When you want to create a pipe in ionic 3 just run ionic g pipe myPipe.

升级到ionic 4+时,它将像正常的角度项目一样创建angular.json.
参见此处("@ ionic/angular":"^ 4.7.1")

When you upgrade to ionic 4+ it will create a angular.json like a normal angular project would do.
See here ("@ionic/angular": "^4.7.1")

然后,您可以从角度运行所有以前使用过的ng命令.

Then you can run all kind of ng command your used to from angular.

这篇关于generate命令需要在Angular项目中运行吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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