This post is based on a StackOverflow answer by Oliver Wienand that I came across while researching the AngularJS pattern described below.
Data binding between controller and directive in AngularJS can be a tricky subject for the uninitiated (and often, even for the initiated). AngularJS is great at providing the magic that makes data flow easily between components on the front end – except when it’s not. This post is an examination of one of the cases where not everything is straightforward.
Passing a callback function into a directive with isolate scope is simple – just a matter of creating the binding in the scope definition (callback: ‘&’). However, there is no built-in equivalent for exposing a directive function to the parent directive or controller. That is, if we have the (truncated) directive definition below, we’re going to have to do some…
As a web developer you’ve inevitably come across situations in which a tool does not exist to assist you with a particular task. The thought of developing your own solution is enticing, especially if it gives you a chance to use a technology you’ve been interested in learning. Unfortunately it’s easy to dismiss implementing your own solution because of uncertainty in the amount of overhead that may be involved. That’s where Google Chrome Extensions come in.