The ability to reply to discussions is limited to PRO members. Want to join in the discussion? Click here to subscribe now.

Unit Testing Directive Scope Binding

Unit Testing Directive Scope Binding

2:00
Digging a little deeper into unit testing an AngularJS directive, this lesson looks at testing binding across multiple scopes.
Watch this lesson now
Avatar
egghead.io

Digging a little deeper into unit testing an AngularJS directive, this lesson looks at testing binding across multiple scopes.

Avatar
Theron

Hi

Do you have the full source to this exercise including the karma.conf.js file?

I cannot get this two-way binding example to work for m. I continually get an exception as it seems that I'm getting 2 instances of a $scope. I seem to recall that there was some change to the two way binding isolate scope in a later release of Angular. I'm not sure if I'm running into that.

thanks!!!

In reply to egghead.io
Avatar
Joel

Hi

Do you have the full source to this exercise including the karma.conf.js file?

I cannot get this two-way binding example to work for m. I continually get an exception as it seems that I'm getting 2 instances of a $scope. I seem to recall that there was some change to the two way binding isolate scope in a later release of Angular. I'm not sure if I'm running into that.

thanks!!!

The problem was with element.scope(). You now need to use element.isolateScope(). I've updated the source for the lesson so you can see the correct code for these tests.

In reply to Theron
Avatar
Theron

thank you so much Joel. This works great. Much appreciated!!!

Theron

In reply to Joel
Avatar
Edgar

Using element.isolateScope() def fixed it it was passing no matter what before

HEY, QUICK QUESTION!
Joel's Head
Why are we asking?