found drama

get oblique

Angular zen: directives and scope

by Rob Friesel

Today’s moment of Angular zen:


Try to think of it this way:

Anything that you set on the scope object in the directive’s return object, those will be the properties pre-populated on the scope argument passed to the scope parameter in the function assigned to link. And those can be inferred from the attributes passed on to the directive’s instance element.

There’s some magic going on there, and it isn’t totally clear from the docs how these things line up. But there’s a science to it.

About Rob Friesel

Software engineer by day, science fiction writer by night; weekend homebrewer. Author of The PhantomJS Cookbook and a short story in Please Do Not Remove. View all posts by Rob Friesel →

Leave a Reply

Your email address will not be published. Required fields are marked *

*

*