0

If I create an Angular directive:

App.directive('modalWindow', function(){
    return {
        restrict: 'EAC',
        link: function(scope, element) {
            elem.draggable();
        }
    }  
});

and then reference it in markup:

    <div class="modalWindow">

and then place a breakpoint on elem.draggable()

will the debugger stop at the breakpoint when the app is run?

EDIT: It is not stopping in Visual Studio, hence my question.

Tim
  • 8,669
  • 31
  • 105
  • 183
  • Yes. I just tried on chrome. A breakpoint set inside returned link function pauses execution same as usual. – chriskelly Sep 13 '14 at 11:31
  • Thanks. To whoever downvoted: please see edit to my question. It's not stopping there in the Visual Studio debugger, so I don't know if that's a debugger issue, a problem in how I wired it up, or something else. I think it's a valid question. – Tim Sep 13 '14 at 11:38

1 Answers1

3

Are you sure the directive link function is being called? Keep in mind that when you camel case the directive name ('modalWindow'), in the HTML, it needs to be snake-cased ('modal-window'). Since you're using a restriction on either element, attribute, or class ('EAC'), first make sure that your link directive is being called. In your HTML, change this to

HTML

<div modal-window></div>

OR

<div class='modal-window'></div>

Try the debugger again and see if Visual Studio pauses now.

rchawdry
  • 1,256
  • 1
  • 10
  • 14