I have the following code in an angular app.
<select ng-options="f as f.name for f in wf"
ng-model="w" ng-change="showChart(w)">
</select>
<button type='button' ng-click="showChart(w)">Display</button>
Both call a jquery function that does the following:
$scope.showChart = function(w){
console.log("Showing chart " + w.identifier);
$('#list-'+ w.identifier).orgChart({container: $('#chart-' + w.identifier)});
console.log("Chart showing");
};
Now, when I change the select I see the 2 log messages in the console, but the chart does not display until I click the button.
When I click the button, the chart displays. After clicking the button, when I change the select the chart changes.
Why would this not be working properly? These 2 tags are right above/below each other on the page, and they do the same thing, it's just that nothing shows up until I click the button.
Clicking the button should do the exact same thing as changing the select, but the select does not work until the button is clicked??