freeCodeCamp/guide/chinese/miscellaneous/creating-a-new-directive-in.../index.md

14 lines
542 B
Markdown
Raw Normal View History

---
title: Creating a New Directive in Angular
localeTitle: 在Angular中创建一个新的指令
---
你还记得从角度过程中形成的自定义指令吗?您也可以制作自定义指令!
```
>> yo angular-fullstack:directive newdirective
```
如果你需要一个自定义指令的html模板也许你只是制定一个指令来清理你的HTML代码告诉它在提示你时创建一个html文件你就可以包含这些内容在您的应用中的任何位置使用该模板
```
<newdirective></newdirective>
```