首页 \ 问答 \ Angular 2的最佳实践(Best Practice of Angular 2)

Angular 2的最佳实践(Best Practice of Angular 2)

Angular 2被认为是前端开发的完整框架。 优点之一是以一种可管理的方式进行前端交互,与jQuery的各种功能形成鲜明对比。

另一方面,jQuery非常灵活,其功能可以按功能逐个按需使用。 它与纯HTML代码很好地协作,尤其是外观设计师准备的漂亮模板。 从这个前瞻来看,jQuery看起来更加敏捷。

应用Angular 2的最佳做法是什么? 它应该与jQuery,bootstrap和其他前端库/框架混合在一起吗? 他们每个人应该承担什么责任?


Angular 2 is considered as a complete framework in frontend development. One of advantages is to put frontend interactions in a managed way, in contrast to various functions of jQuery.

On the other hand, jQuery is very flexible and its features can be applied on demand function by function. It is well collaborated with plain HTML codes, especially good-look templates have been prepared by visual designers. From this prospective, jQuery seems more agile.

What is the best practice of applying Angular 2? Should it be mixed with jQuery, bootstrap, and other frontend library/framework together? What responsibility should each of them take?


原文:https://stackoverflow.com/questions/42411744
更新时间:2023-08-14 13:08

最满意答案

  1. 没有简单的方法来确定响应特定命令将使用哪些键映射。 任何函数都可以随时调用(use-local-map ...) ,因此唯一可以确定的方法是阅读源代码。

    话虽如此,Emacs代码确实遵循的惯例使得在许多情况下找到答案成为可能。 如果foo-mode有一个keymap,那么keymap通常会被命名为foo-mode-map 。 您可以通过运行Mx apropos RET -map$ RET来查看名称以-map结尾的变量列表。

  2. 您可以使用函数lookup-key在键映射中lookup-key 。 请参阅Emacs Lisp手册中的“ Key Lookup的功能 ”。 因此,要找出在isearch-mode-map绑定的RET ,请评估:

    (lookup-key isearch-mode-map (kbd "RET"))
      ===> isearch-exit
    

  1. There's no easy way to determine which keymaps will come into use in response to particular commands. Any function can call (use-local-map ...) whenever it likes, so the only way to be sure is to read the source code.

    Having said that, the Emacs code does follow conventions that make it possible to find the answer in many cases. If foo-mode has a keymap, then the keymap will usually be named foo-mode-map. You can see a list of variables with names ending in -map by running M-x apropos RET -map$ RET.

  2. You can look up a key in a keymap with the function lookup-key. See "Functions for Key Lookup" in the Emacs Lisp manual. So to find out what RET is bound to in isearch-mode-map, evaluate:

    (lookup-key isearch-mode-map (kbd "RET"))
      ===> isearch-exit
    

相关问答

更多
  • 我相信你错过了映射的一个“级别”。 如果你仔细看看你的输入,你有一个字典(key1),其中的内容不是单个' Sendung ',而是一个这样的对象数组。 因此,您无法将key1的内容直接映射到Sendung ivars,而不是创建新类,例如SendungResult 。 @interface SendungResult : NSObject @property (nonatomic, strong) NSString *keyName; @property (nonatomic, stron ...
  • 老实说,我尝试了很多东西,最后决定不做任何改变。 我训练自己考虑捷径,因为他们的字母不是他们在键盘上的位置...所以'j'不是qwe键盘中'j'键的位置,而是dvorak中的实际字母'j'即'c'键。 它对我来说效果很好,我可以触摸类型而不考虑关键位置,而是在字母中 - 没有心理背景的变化。 PS:我只对VIM这样做。 对于其他工具,我使用Dvorak-to-Qwerty重映射器。 我希望这有帮助。 Honestly, I tried a ton of things and finally decided ...
  • 这可能不是最简单的解决方案,但可以打开resources.jar(MacOS上的/Applications/IntelliJIdea.app/lib/resources.jar)文件,找到Keymap_Emacs.xml(位于idea目录中)复制并修改它。 然后,您可以在IntelliJ中创建一个新的键盘映射,以便使用新内容(MacOS上的〜/ Library / Preferences / IntelliJIdea90 / keymaps)对其进行更新。 这样,您可以更改所有键盘映射,而无需单独更改每个操 ...
  • 没有简单的方法来确定响应特定命令将使用哪些键映射。 任何函数都可以随时调用(use-local-map ...) ,因此唯一可以确定的方法是阅读源代码。 话虽如此,Emacs代码确实遵循的惯例使得在许多情况下找到答案成为可能。 如果foo-mode有一个keymap,那么keymap通常会被命名为foo-mode-map 。 您可以通过运行Mx apropos RET -map$ RET来查看名称以-map结尾的变量列表。 您可以使用函数lookup-key在键映射中lookup-key 。 请参阅Emac ...
  • Cmd ( Meta )键如何映射到您的Windows键? 您可以获取完整的Mac键映射XML文件,并使用Windows上的任何键替换meta 。 某些键可能无法正常工作,或者您可能会遇到冲突的映射。 没有简单明了的方法可以开箱即用。 在Mac上,keymap使用Alt , Ctrl , Meta和Shift修饰符。 这不能直接映射到Windows上的3个修改器( Alt , Ctrl , Shift )。 默认情况下, 不能使用Win作为修饰符 。 此外,操作系统已经采用了许多与Win的组合(并且禁用这些 ...
  • 此插件会将您的keymap导出到.PDF文件,然后您可以打印该文件。 This plugin will export your keymap to a .PDF file, which you can then print.
  • 是; 你正在做你现在正在做的事情,只是没有创建和填充新的键盘图。 (global-set-key (kbd "C-~") flyspell-mode-map) 将flyspell-mode-map分配给该键绑定。 Yes; you do exactly what you're doing now, just without creating and populating the new keymap. (global-set-key (kbd "C-~") flyspell-mode-map) will ...
  • 我找到了一种使用python脚本插件的方法。 显然,dsublime的efault没有在单个键映射下运行多个命令的选项。 我使用了这里的方法: https : //forum.sublimetext.com/t/run-multiple-commands-command/6848 步骤如下: Sublime - 工具 - 开发人员 - 新插件 复制来自run_multiple_commands.py的代码: https ://gist.github.com/bgmort/7ae52ea4270f1c4043 ...
  • 好吧,你可以通过绘制一组表示真实多色线中每种颜色的虚拟线来“欺骗”: fig, ax = plt.subplots(1, 1) ax.hold(True) colors = ['r', 'g', 'b'] labels = ['foo', 'bar', 'baz'] dummies = [ax.plot([], [], ls='-', c=c)[0] for c in colors] ax.legend(dummies, labels) 我不确定是否有更简洁的方法。 Well, you c ...
  • 按Ctrl-Alt-Shift-Slash激活“维护”菜单,选择“注册表”,启用editor.skip.copy.and.cut.for.empty.selection选项。 Press Ctrl-Alt-Shift-Slash to activate the "Maintenance" menu, select "Registry", enable the editor.skip.copy.and.cut.for.empty.selection option.

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。