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
The page I'm visiting has a directive that performs a query to the local API to get some models that populate a select for a form:
CarBrand.query().then(function(carBrands){vm.carBrands=carBrands;// this never gets executed, the model is empty});
I've opened the page with save_and_open_page to check the rendering state of the app, and the route is resolved (even without using the waiter mentioned in this other issue) and the form is rendered, but the select options are not populated.
I've run out of clues. I checked if there are pending requests as suggested here but the answer is no, there are no pending requests.
However, when I quit, in the last second the requests appear en in the network tab of firefox, as if something was holding them.
Test:
require"rails_helper"describe"CarListing creation",type: :featuredolet!(:car_version){FactoryGirl.create:car_version}it"creates a CarListing",js: truedovisit"/#/avisos/nuevo"wait_until_angular_readywait_for_route_changessave_and_open_pageselect_by_ng_model"cL_EC.carListing.car.brand",car_version.brand.nameselect_by_ng_model"cL_EC.carListing.car.model",car_version.model.nameselect_by_ng_model"cL_EC.carListing.car.versionId",car_version.idfill_in_by_ng_model"cL_EC.carListing.car.year",1996enddeffill_in_by_ng_model(ng_model,value)find_by_ng_model(ng_model).setvalueenddefselect_by_ng_model(ng_model,value)find_by_ng_model(ng_model).find(:css,"option[value='#{value}']").select_optionenddeffind_by_ng_model(ng_model)find(:css,"[ng-model='#{ng_model}']")endend
I tried https://github.com/kikonen/capybara-ng with the same results. AFAIK, this library angularjs-rails-resource is just a wrapper around $http calls.
Any help is aprettiated!
The text was updated successfully, but these errors were encountered:
Have you tried putting the query in the controller of the page instead of your directive? is your directive even going through the linking or not at all? sounds to me like your directive is compiled later than when you request it. I personally have a routeProvider and some directives doing some loading and it works fine without waiting for angular at all, even before I used this library, so prob the problem lies somewhere else
I'm using ui.router and angularjs-rails-resource.
The page I'm visiting has a directive that performs a query to the local API to get some models that populate a select for a form:
I've opened the page with
save_and_open_page
to check the rendering state of the app, and the route is resolved (even without using the waiter mentioned in this other issue) and the form is rendered, but the select options are not populated.I've run out of clues. I checked if there are pending requests as suggested here but the answer is no, there are no pending requests.
However, when I quit, in the last second the requests appear en in the network tab of firefox, as if something was holding them.
Test:
I tried https://github.com/kikonen/capybara-ng with the same results. AFAIK, this library angularjs-rails-resource is just a wrapper around $http calls.
Any help is aprettiated!
The text was updated successfully, but these errors were encountered: