sitepoint.com sitepoint.com

Mastering $watch in AngularJS

This article was peer reviewed by Mark Brown. Thanks to all of SitePoint’s peer reviewers for making SitePoint content the best it can be! AngularJS offers many different options to use the publish-subscribe pattern through three different “watch” methods. Each of them takes optional parameters that can modify its behavior. The official documentation on $watch is anything but thorough: a problem that has afflicted...

sitepoint.com sitepoint.com

Three JavaScript Quirks That Java/C Developers Should Know

table.sp_table { width: 100%; border-collapse: collapse; border-spacing: 0; } table.sp_table td, table.sp_table th { border: solid 1px #ccc; padding: 10px; line-height: 1.5; text-align: center; width: 20%; } table.sp_table tr td:first-child { font-weight: bold; } JavaScript can be a deceiving language and it can be a real pain because it isn’t 100% consistent. As it’s well known it does have bad parts,...

jspro.com jspro.com

Emerging Patterns in JavaScript Event Handling

During the last few months the debate on the web about the best way to handle events has thrived. First, a few months ago, Google released the JsAction library; then, more recently, the Object.observe() method was introduced as part of the ECMAScript 7 specification (but already supported in Chrome 36 and Node.js Harmony). Developers had already been taking sides on whether it is still "mandatory" to have all the logic...

sitepoint.com sitepoint.com

Emerging Patterns in JavaScript Event Handling

During the last few months the debate on the web about the best way to handle events has thrived. First, a few months ago, Google released the JsAction library; then, more recently, the Object.observe() method was introduced as part of the ECMAScript 7 specification (but already supported in Chrome 36 and Node.js Harmony). Developers had already been taking sides on whether it is still “mandatory” to have all the logic...