I'm having problem of initializing "elements" in COMPONENTS with data coming from web-request. F.e. (pseudo code) :
<elem elemOpts="$ctrl.elemOpts" />
.......
ctrl = this;
ctrl.web_data = [];
ctrl.elemOpts = { data : ctrl.web_data }
ctrl.$onInit = function() {
$http({ ... }).then(function(response) {
ctrl.web_data = response.data;
})
}
This is not working, because the ELEMENT is initialized before $onInit(), so the web request comes afterwards. Is there a way to execute COMPONENT-code before elements are rendered ?
Two cases which I have this problem is ui-grid and multiselect, where I have to initialize select-boxes from web-request.