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/10/17 0:22:30 阅读更多 →
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/10/15 21:01:41 阅读更多 →
Azure日志下载_azp-logs

Azure日志下载_azp-logs

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

2026/10/6 7:27:51 阅读更多 →

最新新闻

操作系统核心算法复试考点全梳理:调度、页面置换与死锁

操作系统核心算法复试考点全梳理:调度、页面置换与死锁

考研复试操作系统算法这东西,说难也难,说简单也简单。难是因为它横跨了并发、调度、内存、文件系统、死锁五座大山,每座山里都蹲着几个绕不开的经典问题;简单是因为复试考来考去就那么几十道题,出题人绕不开那些“祖宗…

2026/10/17 0:33:00 阅读更多 →
UG二次开发实战:从环境配置到参数化建模的完整链路

UG二次开发实战:从环境配置到参数化建模的完整链路

简介:本资源是面向UG(Unigraphics)初学者与进阶开发者的系统性二次开发学习合集,聚焦C API编程、GRIP脚本开发、插件构建与UI定制等核心能力,助力工程师在航空航天、汽车制造等领域实现设计流程自动化与功能深度扩展。…

2026/10/17 0:33:00 阅读更多 →
Windows Server 2022 Web服务器搭建与DNS域名解析完整指南

Windows Server 2022 Web服务器搭建与DNS域名解析完整指南

简介:这份资源面向IT运维人员、系统管理员及计算机相关专业学生,聚焦Windows Server 2022环境下Web服务器的搭建与配置,帮助读者掌握从系统安装到网站上线的完整流程。内容涵盖服务器安装、功能测试、网站挂载与站点配置,以及DNS域…

2026/10/17 0:33:00 阅读更多 →
5G NR OAM子系统:从FCAPS到三大业务流的落地实践

5G NR OAM子系统:从FCAPS到三大业务流的落地实践

简介:面向5G NR网络平台研发与运维人员的课程资源,系统梳理OAM(操作、管理、维护)子系统的核心架构与关键机制。内容从Makefile工程构建框架切入,深入讲解RT实时补丁下的平台框架、IOS跨操作系统能力、初始化配置表与上…

2026/10/17 0:33:00 阅读更多 →
共享存储挂载失败:dmsetup remove_all 与 Device-Mapper 残留映射排错指南

共享存储挂载失败:dmsetup remove_all 与 Device-Mapper 残留映射排错指南

简介:这份资源聚焦 Linux 存储管理中的典型故障场景:同一存储设备挂载到两台服务器后,一台挂载成功、另一台却无法挂载或提示存储正忙。内容围绕 Device-Mapper 框架与 dmsetup 命令展开,适合有一定 Linux 基础、正在处理共享存储…

2026/10/17 0:33:00 阅读更多 →
惯性导航解算算法实现:从IMU数据到ECEF位置的六步闭环

惯性导航解算算法实现:从IMU数据到ECEF位置的六步闭环

简介:本资源是一套完整的惯性导航解算算法实现工程,面向导航制导、智能无人系统、机器人定位等方向的本科生、研究生及嵌入式开发者,聚焦于INS核心姿态解算、加速度积分与卡尔曼滤波校正等关键环节,解决无GPS环境下自主定位与姿态…

2026/10/17 0:31:59 阅读更多 →

日新闻

DeepSeek选型与部署:V3/R1、Ollama、API全攻略

DeepSeek选型与部署:V3/R1、Ollama、API全攻略

简介:《DeepSeek使用方法.pdf》是一份面向DeepSeek入门及进阶用户的完整使用指南,重点围绕V3与R1两款模型的能力差异与适用场景展开,帮助读者根据任务类型与成本选择合适的模型。资源共1个PDF文件,压缩包大小约311KB,篇…

2026/10/17 0:00:25 阅读更多 →
200+Deepseek润色指令拆解:从底层原理到场景落地的完整指南

200+Deepseek润色指令拆解:从底层原理到场景落地的完整指南

简介:这是一份聚焦DeepSeek提示词优化的《200Deepseek润色指令》PDF文档,共收录两百余条可直接套用的润色指令,涵盖语法修正、风格统一、逻辑梳理、表达精炼等维度,并针对商务写作、学术论文、广告文案等场景给出差异化建议。文档…

2026/10/17 0:00:25 阅读更多 →
OpenCV轮廓法物体计数系统:轻量、可控、可落地的工业级实现

OpenCV轮廓法物体计数系统:轻量、可控、可落地的工业级实现

简介:本资源是一份基于OpenCV的本科课程设计完整报告,面向计算机视觉初学者、图像处理学习者及高校通信/信息类专业学生,解决物体智能计数与检测结果结构化记录的实际问题。项目覆盖图像预处理、轮廓检测、边界框绘制、轨迹栏交互式参数调节、…

2026/10/17 0:00:25 阅读更多 →

周新闻

流感时间序列预测实战:ARIMA/LSTM全流程拆解与避坑指南

流感时间序列预测实战:ARIMA/LSTM全流程拆解与避坑指南

简介:基于 ARIMA、LSTM、Transformer 等模型的流感时间序列预测 Python 源码,面向计算机相关专业课程设计与期末大作业学生,以及项目实战学习者。内容覆盖预处理、平稳性检验、定阶、残差分析、多模型对比预测的完整时序建模流程,…

2026/10/16 21:35:51 阅读更多 →
影刀RPA新手教程:键盘模拟输入实战——输入文本与模拟按键的区别

影刀RPA新手教程:键盘模拟输入实战——输入文本与模拟按键的区别

影刀RPA新手教程:键盘模拟输入实战——输入文本与模拟按键的区别 做影刀RPA自动化,十个新手有八个栽在"往输入框里填东西"这件事上:要么填不进去,要么填了一半,要么直接把原来内容追加在后面。这背后的根因&…

2026/10/15 19:41:51 阅读更多 →
影刀RPA新手教程:阅文起点小说数据采集实战——书籍信息与章节内容

影刀RPA新手教程:阅文起点小说数据采集实战——书籍信息与章节内容

影刀RPA新手教程:阅文起点小说数据采集实战——书籍信息与章节内容 1. 认识影刀:什么场景该用RPA采小说数据 起点中文网的页面结构相对稳定——分类榜单、书籍详情、章节内容三块独立页面,跳转链路清晰。这种场景非常适合影刀自动化&#x…

2026/10/16 15:04:24 阅读更多 →

月新闻

我发现了一个新思路:用 Remotion + Claude Code 像写代码一样自动化生成短视频

我发现了一个新思路:用 Remotion + Claude Code 像写代码一样自动化生成短视频

/* MD / 富文本中的 .toc(含博客园搬家等嵌套结构);.toc-box 在侧栏,不受影响 */#content_views .toc,/* 编辑器常在目录前后插入空 p(:empty 仍占 20px),一并去掉避免顶空隙 */#content_views.markdown_views > p:empty:has(+ .toc),#content_views.markdown_views …

2026/10/16 21:54:38 阅读更多 →
Windows下 Codex 中 Chrome 和 Computer Use 插件不可用问题排查及解决参考方式:TaoToken 统一 Key 配置与验证

Windows下 Codex 中 Chrome 和 Computer Use 插件不可用问题排查及解决参考方式:TaoToken 统一 Key 配置与验证

/* MD / 富文本中的 .toc(含博客园搬家等嵌套结构);.toc-box 在侧栏,不受影响 */#content_views .toc,/* 编辑器常在目录前后插入空 p(:empty 仍占 20px),一并去掉避免顶空隙 */#content_views.markdown_views > p:empty:has(+ .toc),#content_views.markdown_views …

2026/10/16 3:49:43 阅读更多 →
黑夜航拍船只数据集训练YOLOV5模型全流程解析

黑夜航拍船只数据集训练YOLOV5模型全流程解析

/* MD / 富文本中的 .toc(含博客园搬家等嵌套结构);.toc-box 在侧栏,不受影响 */#content_views .toc,/* 编辑器常在目录前后插入空 p(:empty 仍占 20px),一并去掉避免顶空隙 */#content_views.markdown_views > p:empty:has(+ .toc),#content_views.markdown_views …

2026/10/16 14:23:36 阅读更多 →