Please check it here: http://jsfiddle.net/9VaW2/1/
I want jData
be available outside
$http({method: 'POST', url: '/someurl'}).
success(function(data, status, headers, config) {
var jData = data;
}).
error(function(data, status, headers, config) {
});
But when I do this:
$view.availableData = {
cols:{ID:'ID', Date:'Date'},
rows:{data:jData},
options:{}
};
It gives me this error
ReferenceError: jData is not defined
EDIT update fiddle
http://jsfiddle.net/9VaW2/3/
** I think I found a solution to make a synchronous call ..async : false
. that works. I think the page was loading faster than the data was coming back.... wonder if someone has a better solution **