You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As of alpha-37 it is only available through 'angular2/src/test_lib/utils'
Maybe I'm missing a better technique but the way I know to trigger DOM events is through something like dispatchEvent. For example, I have test code that looks like this:
// get the HTML element and change its value in the DOM
var input = rootTC.query(By.css('input')).nativeElement;
input.value = "Dog Man"
dispatchEvent(input, 'change'); // event triggers Ng to update model
I think I stole it from one of the Angular core tests.
Alternative (perhaps better?), expose DOM so we can do it ourselves (and more) as in:
Activity
juliemr commentedon Oct 13, 2015
Done with a1fa2e4
IgorMinar commentedon Oct 13, 2015
dispatchEvent was not meant to be public api. it's an internal helper that leaked.
we should provide a more ergonomic way to trigger events post AngularConnect. in the meantime you can use regular dom apis to create and dispatch events. https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/dispatchEvent
angular-automatic-lock-bot commentedon Sep 7, 2019
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.