我刚刚开始使用 Ember.js 并试图了解其项目中使用的一些约定,我想知道,例如, Controller 的正确命名法是 App.ApplicationController
还是 App.applicationController
?
我看过两者的代码示例。
最佳答案
Ember 的命名约定非常简单。 大写的单词表示类别,小写的表示实例,正如 Peter Wagenet 所说:
If it's a class or a namespace, it's uppercase; if it's an instance, it's lowercase.
我建议你阅读它的帖子:The Emberist: Naming convention .
你可以看看这个博客里的所有其他帖子,它们真的很有趣。
关于javascript - 什么是 Ember.js Controller 命名约定?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12450606/