Closed crisryantan closed 8 years ago
Remember $.on is just a listener. similar to $emit and $broadcast. If you are using Jasmine you can spy on it can call through. If you just want to see if it has been called you can do like so
var emitOccur = false;
$rootScope.$on('$methodsBound', function () {
emitOccur = true;
});
//** $emit occurs on $compile. Compiling again so listener is set up Need to call
//compile after emit
$compile(element)($rootScope);
$rootScope.$digest(element);
//expect(emitOccur).toBe(true);
expect(emitOccur).to.be.true;
I am literally testing this over and over. Let me know if that doesn't work and/or feel free to point me to your issue on stack overflow and I can help you with it there if still having an issue. I am assuming by the date of this you probably fixed it by now.
thanks! yes it has been fixed. sorry forgot to close
http://stackoverflow.com/questions/33005131/typeerror-undefined-is-not-a-function-evaluating-scope-on