官术网_书友最值得收藏!

Angular's philosophy

The philosophy behind Angular is to err on the side of configuration over convention. Convention-based frameworks, although may seem elegant from the outside, make it really difficult for newcomers to pick up the framework. Configuration-based frameworks, however, aim to expose their inner workings through explicit configuration elements and hooks, where you can attach your custom behavior to the framework. In essence, Angular tries to be non-magical, where AngularJS was a lot of magic.

This results in a lot of verbose coding. This is a good thing. Terse code is the enemy of maintainability, only benefiting the original author. However, as Andy Hunt and David Thomas put it in the Pragmatic Programmer,

Remember that you (and others after you) will be reading the code many hundreds of times, but only writing it a few times.

Verbose, decoupled, cohesive, and encapsulated code is the key to future proofing your code. Angular, through its various mechanisms, enables the proper execution of these concepts. It gets rid of many custom conventions invented in AngularJS, such as ng-click, and introduces a more intuitive language that builds on the existing HTML elements and properties. As a result, ng-click becomes (click), extending HTML rather than replacing it.

主站蜘蛛池模板: 安泽县| 大厂| 荆州市| 泸水县| 长沙市| 汉源县| 光山县| 胶南市| 中西区| 庄浪县| 宁明县| 东平县| 高淳县| 麦盖提县| 库尔勒市| 金湖县| 韶山市| 长沙市| 丹凤县| 偏关县| 化州市| 航空| 芦溪县| 青川县| 高雄市| 平遥县| 南昌市| 灵宝市| 健康| 绥芬河市| 铜梁县| 平山县| 双鸭山市| 庄河市| 东乡族自治县| 安溪县| 宁远县| 定南县| 揭阳市| 晴隆县| 鲁甸县|