Check out the contents, {{name}}!
@@ -747,7 +747,8 @@ callback functions to directive behaviors.
When the user clicks the `x` in the dialog, the directive's `close` function is called, thanks to
`ng-click.` This call to `close` on the isolated scope actually evaluates the expression
-`hideDialog()` in the context of the original scope, thus running `Ctrl`'s `hideDialog` function.
+`hideDialog()` in the context of the original scope, thus running `Controller`'s `hideDialog`
+function.
**Best Practice:** use `&attr` in the `scope` option when you want your directive
@@ -766,8 +767,8 @@ element?
- angular.module('dragModule', []).
- directive('myDraggable', function($document) {
+ angular.module('dragModule', [])
+ .directive('myDraggable', ['$document', function($document) {
return function(scope, element, attr) {
var startX = 0, startY = 0, x = 0, y = 0;
@@ -801,7 +802,7 @@ element?
$document.unbind('mouseup', mouseup);
}
};
- });
+ }]);
Drag ME