angularjs 视图是否有命名约定?
Is there a naming convention for angularjs views?
例如,我有 not found
html 页面。我应该命名吗
1. not-found.html
2. notFound.html
文件名约定是什么?
如果你遵循john papaangular风格,那就不是-found.html。但说真的,请选择您认为最自然的那个 :)
虽然我不知道广泛采用的约定,但我个人使用驼峰式 notFound.html
。我喜欢跨 Angular 个文件执行此操作,因此 notFound.directive.html
用于与 notFound.directive.js
指令关联的模板。
Angular 中需要注意的一项要求是,在 HTML 中引用时,驼峰指令名称需要转换为 "dashed"。因此,要在 HTML 中引用 notFound
指令,您需要引用 <not-found></not-found>
.
在 Angular 常规方面帮助我的一个资源是 John Papa 的风格指南,发现 here。请注意,他实际上建议 not-found.html
,但这个具体情况还是取决于个人喜好。
例如,我有 not found
html 页面。我应该命名吗
1. not-found.html
2. notFound.html
文件名约定是什么?
如果你遵循john papaangular风格,那就不是-found.html。但说真的,请选择您认为最自然的那个 :)
虽然我不知道广泛采用的约定,但我个人使用驼峰式 notFound.html
。我喜欢跨 Angular 个文件执行此操作,因此 notFound.directive.html
用于与 notFound.directive.js
指令关联的模板。
Angular 中需要注意的一项要求是,在 HTML 中引用时,驼峰指令名称需要转换为 "dashed"。因此,要在 HTML 中引用 notFound
指令,您需要引用 <not-found></not-found>
.
在 Angular 常规方面帮助我的一个资源是 John Papa 的风格指南,发现 here。请注意,他实际上建议 not-found.html
,但这个具体情况还是取决于个人喜好。