AngularJS 风格指南 - Todd Motto vs John Papa vs Minko Gechev [英] AngularJS Style Guides - Todd Motto vs John Papa vs Minko Gechev

查看:20
本文介绍了AngularJS 风格指南 - Todd Motto vs John Papa vs Minko Gechev的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对 Angular 还是很陌生,我想从一开始就学习好的做法.我遇到了三个 Angular 风格指南,它们看起来都很棒.我想知道哪一个最适合我采用,但我没有资格对此进行评判,因为我对大型 Angular 应用程序几乎没有经验.

I'm pretty new to Angular and I'd like to learn good practices from the beginning. I've come across three Angular style guides and they all seem to be great. I'd like to know which one would be best for me to adopt, but I'm in no position to be the judge on that, since I have little experience with big Angular apps.

那么哪个是最好的?或者即使不是更好,那么更直观/在开发过程中引起的问题更少?也许你们中的一些人对所有这些都有经验,并且可以指出它们的优缺点?

So which one is the best? Or even if not better, then more intuitive / causing less problems during development? Maybe some of you have experience with all of them and can point out their pros and cons?

链接:

推荐答案

我已经阅读了 Motto 和 Papa 的指南,并且他们 90% 的时间都同意相同的指南和用法.座右铭简短且易于理解,爸爸的座右铭很长但几乎涵盖了所有内容.我认为你最好从它们中的任何一个开始(最好是较短的),当你遇到新事物时(例如:你可能一开始没有实现指令,但过了一段时间)然后去阅读指令部分.不要试图从上到下阅读所有内容,因为这可能会使您感到困惑.从最需要的开始,然后开始编写应用程序.

I have gone through Motto's and Papa's guides and 90% of the time they agree on same guides and usage. Motto's is short and easy to follow, Papa's is long but covers almost everything. I think you better be start with either of them (preferably shorter one) and when you comes to new thing (ex: you may not implementing directive at first but after sometime) then go and read directives section. Don't try to read everything top to bottom as it may confuse you. Start with most needed ones you to go and start coding the application.

  • 文件结构 (Minko) - 应用程序结构 (Papa)
  • IIFE(爸爸)
  • 模块(格言,爸爸) - 模块化(爸爸)
  • 控制器声明和最佳实践(格言,爸爸)
  • 服务声明和最佳实践(格言,爸爸)
  • 评论(格言,爸爸)
  • 命名(爸爸)

这些应该足以让您开始并使用 Angular 完成大部分开发工作,然后当您进入 Angular 的新领域时——比如说,如果您打算构建指令——然后去阅读有关这些的部分指南.否则,您只会花几天时间阅读和思考指南,而无需进行实际工作.除非您确实使用它,否则您将看不到自己实现某事的最佳方式,而且看不到最佳实践背后的原因.

These should be enough you to start and do most of your development work with Angular, then when you come to new area of angular--say if you're planning to build directive--then go and read that section on those guides. Otherwise you will just spend days reading and thinking about guides without doing actual work. Unless you do use it you won't see the best way to implement something by yourself moreover reasons behind the best practices.

这篇关于AngularJS 风格指南 - Todd Motto vs John Papa vs Minko Gechev的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆