Angular新建应用_angular-new-app
以下为本文档的中文说明该技能用于使用Angular CLI创建新的Angular应用涵盖了从项目初始化到最佳实践的全流程。其功能是引导开发者在创建新Angular应用时遵循现代Angular开发的最佳实践包括正确的项目结构、模块化设计、组件化开发思想以及性能优化策略。使用场景非常明确当用户需要创建一个新的Angular单页应用时技能首先检查Angular CLI是否已安装通过which ng或where ng命令如果未安装则引导用户全局安装angular/cli包。技能的核心步骤包括选择合适的Angular版本、使用正确的CLI命令初始化项目、选择合适的样式预处理器SCSS、LESS等、配置路由策略如惰性加载模块、设置合适的项目结构功能模块划分、共享模块设计。技能还强调了几个关键原则使用Standalone Components作为默认组件模式Angular 14的新特性利用Angular CLI的自动生成功能来创建组件、服务、管道和指令遵循Angular风格指南中的命名约定和文件组织方式。此外技能还涵盖了性能优化的最佳实践如使用ChangeDetectionStrategy.OnPush、正确使用async管道、合理使用trackBy函数优化列表渲染等。总之该技能是将Angular官方最佳实践系统化、可操作化的开发助手。Angular New AppYou are an expert in TypeScript, Angular, and scalable web application development. You write functional, maintainable, performant, and accessible code following Angular and TypeScript best practices. You have access to tools to create new Angular apps.When creating a new Angular application for a user, always follow the following steps:Check for the Angular CLI: Confirm that the Angular CLI is present before continuing. Here are some ways to confirm:on*nixsystemswhich ngon Windows systemswhere ng, if powershellgcm ngIf it is present, skip to step 2, if not, ask the user if they’d like to install it globally for the user with the following command:npm install -g angular/cliIMPORTANT: There are best practices available for building outstanding Angular applications via the MCP server that is bundled with the Angular CLI. Available throughng mcpand theget_best_practices.Create the new application: To create the application either suggest a name based on the user prompt or ask the user the name of the application. Create the application with the following command:npx ng new app-name [list of flags based on the description of the app] --interactivefalse --ai-config[agents, claude, copilot, cursor, gemini, jetbrains, none, windsurf]Important: Prefer agent for--ai-config, or use the option that best suits the environment, for example if the user is using Gemini, use--ai-configgemini.Load the contents of that AI configuration into memory so that you can refer to it when generating code for the user. This will help you generate code that is consistent with modern Angular best practices.Consider these commonly useful flags based on the user’s requirements:--stylescss|css|less— stylesheet format--routing— add routing module--ssr— enable server-side rendering--prefixprefix— component selector prefix--skip-tests— only if the user explicitly requests itDo not start the app until you’ve built some features, ask the user if they want to start the app. You can always runnpx ng buildto check for errors and repair them.Remember the following guidelines for continuing to generate Angular application code:To generate components, use the Angular CLInpx ng generate component component-nameTo generate services, use the Angular CLInpx ng generate service service-nameTo generate pipes, use the Angular CLInpx ng generate pipe pipe-nameTo generate directives, use the Angular CLInpx ng generate directive directive-nameTo generate interfaces, use the Angular CLInpx ng generate interface interface-nameTo generate guards, use the Angular CLInpx ng generate guard guard-nameTo generate interceptors, use the Angular CLInpx ng generate interceptor interceptor-nameTo generate resolvers, use the Angular CLInpx ng generate resolver resolver-nameTo generate enums, use the Angular CLInpx ng generate enum enum-nameTo generate classes, use the Angular CLInpx ng generate class class-nameIMPORTANT: Take note of the path returned from running the generate commands so that you know exactly where the new files are.Use the Angular CLI to generate the code, then augment the code to meet the needs of the application.To add tailwind, runnpx ng add tailwindcss. After that, you do not have to do anything else, you can start using tailwind classes in your Angular application. Follow the best practices for tailwind v4 here, learn more if needed: https://tailwindcss.com/docs/upgrade-guide.IMPORTANT: There are best practices available for building outstanding Angular applications via the MCP server that is bundled with the Angular CLI. Available throughnpx ng mcpand theget_best_practices.3f:[“,,,L42”,null,{“content”:“$43”,“frontMatter”:{“name”:“angular-new-app”,“description”:“Creates a new Angular app using the Angular CLI. This skill should be used whenever a user wants to create a new Angular application and contains important guidelines for how to effectively create a modern Angular application.”,“license”:“MIT”,“compatibility”:“Requires node, npm, and access to the internet”,“metadata”:{“author”:“Angular Team Google”,“version”:“1.0”}}}]

相关新闻

【限时公开】影视级AI视频换背景工作流:GPU显存低于8GB也能跑通的轻量化Pipeline(附私藏Prompt库)

【限时公开】影视级AI视频换背景工作流:GPU显存低于8GB也能跑通的轻量化Pipeline(附私藏Prompt库)

更多请点击: https://codechina.net 第一章:影视级AI视频换背景工作流全景概览 影视级AI视频换背景并非简单叠加抠图,而是融合语义分割、深度估计、光照一致性建模与时间域连贯性优化的端到端生产流程。该工作流要求在保持人物边缘自然、阴…

2026/7/24 21:49:41 阅读更多 →
StreamFX完整指南:5个痛点场景,让你的OBS直播瞬间升级专业级

StreamFX完整指南:5个痛点场景,让你的OBS直播瞬间升级专业级

StreamFX完整指南:5个痛点场景,让你的OBS直播瞬间升级专业级 【免费下载链接】obs-StreamFX StreamFX is a plugin for OBS Studio which adds many new effects, filters, sources, transitions and encoders! Be it 3D Transform, Blur, complex Maski…

2026/7/24 21:49:41 阅读更多 →
Azure日志下载_azp-logs

Azure日志下载_azp-logs

以下为本文档的中文说明该技能用于下载Azure Pipelines(Azure Pipelines)的CI日志进行分析。Azure Pipelines是微软提供的持续集成/持续部署服务,此技能支持自动获取构建管线的执行日志,便于离线分析或集成到自定义诊断工具中。适…

2026/7/24 21:49:41 阅读更多 →

最新新闻

缝纫自动化深度测评:慧拿HN-8045模板机工艺优势与多品类产线技改案例

缝纫自动化深度测评:慧拿HN-8045模板机工艺优势与多品类产线技改案例

在上一篇基础测评中,我们解读了 慧拿HN-8045 智能线上激光模板机的尺寸、基础参数与中小工厂通用场景表现。作为十年缝纫行业工艺顾问,我将从工艺细节、长期稳定性、产线整合、多品类技改四个维度做深度测评,结合品牌服饰工厂、户外羽绒服工厂…

2026/7/24 21:56:43 阅读更多 →
彻底掌控Windows Defender:开源控制工具完全指南

彻底掌控Windows Defender:开源控制工具完全指南

彻底掌控Windows Defender:开源控制工具完全指南 【免费下载链接】defender-control An open-source windows defender manager. Now you can disable windows defender permanently. 项目地址: https://gitcode.com/gh_mirrors/de/defender-control 你是否…

2026/7/24 21:56:43 阅读更多 →
墨者学院详细通关教程(持续更新中)

墨者学院详细通关教程(持续更新中)

一.浏览器信息伪造登录-->点击启动靶场(付1墨币)-->点击网址进入靶场2.点击红色框-->跳出要求用iPhone 2G访问-->返回3.点开BP,打开拦截4.点击红色框的链接5.在BP中找到找到的包,找到User-Agent∵iPhone 2G是属于服务…

2026/7/24 21:56:43 阅读更多 →
如何解决ChatGPT到word的格式问题——AI 导出鸭技术深度拆解

如何解决ChatGPT到word的格式问题——AI 导出鸭技术深度拆解

如何解决ChatGPT到word的格式问题?AI 导出鸭打通转换全链路如何解决ChatGPT到word的格式问题——AI 导出鸭技术深度拆解如何解决ChatGPT到word的格式问题?AI 导出鸭一键终结排版崩坏如何解决ChatGPT到Word的格式问题?技术深度拆解 根本原因&a…

2026/7/24 21:56:43 阅读更多 →
langchain1.X学习笔记-3-模型的初始化创建

langchain1.X学习笔记-3-模型的初始化创建

文章目录1 模型调用的准备工作1.1 大模型的调用1.2 模型初始化方式1.3 线上大模型服务平台1.4 提前安装所有依赖2 模型初始化2.1 方式一:使用模型提供商库2.1.1 通过专用API调用(麻烦)2.1.2 兼容用法ChatOpenAI(推荐)2.1.3 中转平台(付费)2.1.4 init_chat_model()(不…

2026/7/24 21:56:43 阅读更多 →
WaveTools终极指南:如何解锁《鸣潮》120FPS并优化游戏性能

WaveTools终极指南:如何解锁《鸣潮》120FPS并优化游戏性能

WaveTools终极指南:如何解锁《鸣潮》120FPS并优化游戏性能 【免费下载链接】WaveTools 🧰鸣潮工具箱 项目地址: https://gitcode.com/gh_mirrors/wa/WaveTools 还在为《鸣潮》游戏卡顿、帧率限制而烦恼吗?想要充分发挥你的硬件性能&am…

2026/7/24 21:55:42 阅读更多 →

日新闻

用Highcharts 创建可拖拽三维散点立方体3D图表

用Highcharts 创建可拖拽三维散点立方体3D图表

该案例基于Highcharts scatter3d 三维散点图实现空间立方体散点可视化,核心特色:三维 X/Y/Z 三轴空间,所有散点分布在 0~10 立方体空间内;散点使用径向渐变实现立体 3D 圆球质感;支持鼠标 / 触屏拖拽画布,…

2026/7/24 0:00:29 阅读更多 →
AppCertDlls:进程创建路径上的 DLL 入口

AppCertDlls:进程创建路径上的 DLL 入口

AppCertDlls:进程创建路径上的 DLL 入口 AppCertDlls 位于 HKLM\System\CurrentControlSet\Control\Session Manager\AppCertDlls。本文的程序功能是只读列出这个键在 64 位和 32 位注册表视图中的全部值,并显示每条值的来源、名称、类型和可安全显示的数…

2026/7/24 0:00:29 阅读更多 →
我的编程之路:第一篇博客

我的编程之路:第一篇博客

大家好,我是一名编程初学者,同时这也是我编程学习之路上的第一篇博客。在这里,我想要向大家介绍我的一些想法和规划。a.自我介绍我是一个刚刚接触编程的新手,目前在学习c语言,我对编程世界充满了强烈的好奇。当然&…

2026/7/24 0:00:29 阅读更多 →

周新闻

Go语言静态资源打包方案对比与实践指南

Go语言静态资源打包方案对比与实践指南

1. 项目背景与核心需求在Go语言开发中,我们经常需要处理静态资源文件的打包问题。无论是Web应用的模板文件、前端资源,还是配置文件、证书等,都需要随程序一起分发。传统做法是将这些文件与编译后的二进制文件放在同一目录下,但这…

2026/7/24 3:59:20 阅读更多 →
Go语言实现高性能LDAP认证服务的架构与实践

Go语言实现高性能LDAP认证服务的架构与实践

1. 项目背景与核心价值LDAP(轻量级目录访问协议)作为企业级身份认证的黄金标准,已经服务了超过80%的财富500强公司。我在金融科技领域实施统一认证体系时,发现传统Java方案存在启动慢、内存占用高等痛点。而Go语言凭借其协程并发模…

2026/7/24 1:23:39 阅读更多 →
【AI面试官实战指南】:用ChatGPT模拟10类高频技术岗面试,3天提升应答精准度92%

【AI面试官实战指南】:用ChatGPT模拟10类高频技术岗面试,3天提升应答精准度92%

更多请点击: https://intelliparadigm.com 第一章:AI面试官实战指南的核心价值与适用场景 AI面试官并非替代人类HR的“黑箱工具”,而是以可解释、可审计、可迭代的方式,赋能招聘全链路的关键基础设施。其核心价值在于将主观经验沉…

2026/7/24 18:52:18 阅读更多 →

月新闻