I have an instruction that uses a select drop down that receives data from an async web request After completing the web request, I update the variable that is bound to select the NG-model, and can update the scope through a scope. $ Applied () Due to the async nature of web updates this update has been wrapped in setTimeout, but in my provided JSfield I have emulated this call because of some delays on SetTimeout.
The problem is as follows: Whenever everything works as expected, if you inspect the selected element, then there are 'selected' attributes of the options, which I trust for unit testing. . If I get rid of setTimeout and just update the model with
scope.currentModel = scope.datalist [_ findIndex (scope.datalist, {'code': scope.ngModel}) Can]; . Scope $ apply ();
then the correct option
selected = "selected"
is the attribute, for my unit Can I use the test? So my question is, why, when I use set-timeout, what model is updated and reflected in the browser, but the selected option does not get the selected attribute? It looks like this happens in both Safari and Chrome for Mac, which is not tested on Windows.
Comments
Post a Comment