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
最满意答案
没有简单的方法来确定响应特定命令将使用哪些键映射。 任何函数都可以随时调用
(use-local-map ...)
,因此唯一可以确定的方法是阅读源代码。话虽如此,Emacs代码确实遵循的惯例使得在许多情况下找到答案成为可能。 如果
foo-mode
有一个keymap,那么keymap通常会被命名为foo-mode-map
。 您可以通过运行Mx apropos RET -map$ RET
来查看名称以-map
结尾的变量列表。您可以使用函数
lookup-key
在键映射中lookup-key
。 请参阅Emacs Lisp手册中的“ Key Lookup的功能 ”。 因此,要找出在isearch-mode-map
绑定的RET
,请评估:(lookup-key isearch-mode-map (kbd "RET")) ===> isearch-exit
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 namedfoo-mode-map
. You can see a list of variables with names ending in-map
by runningM-x apropos RET -map$ RET
.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 whatRET
is bound to inisearch-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)对其进行更新。 这样,您可以更改所有键盘映射,而无需单独更改每个操 ...
-
Emacs,探测任意键映射(Emacs, probing arbitrary keymap)[2021-08-12]
没有简单的方法来确定响应特定命令将使用哪些键映射。 任何函数都可以随时调用(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的组合(并且禁用这些 ...
-
IntelliJ - 打印我的键盘映射(IntelliJ - print my keymap)[2023-06-29]
此插件会将您的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.