{"action":"closed","issue":{"url":"https://api.github.com/repos/DataTorrent/malhar-angular-dashboard/issues/142","labels_url":"https://api.github.com/repos/DataTorrent/malhar-angular-dashboard/issues/142/labels{/name}","comments_url":"https://api.github.com/repos/DataTorrent/malhar-angular-dashboard/issues/142/comments","events_url":"https://api.github.com/repos/DataTorrent/malhar-angular-dashboard/issues/142/events","html_url":"https://github.com/DataTorrent/malhar-angular-dashboard/issues/142","id":100636963,"number":142,"title":"Swapping out a widget dynamically","user":{"login":"robertmazzo","id":8823366,"avatar_url":"https://avatars.githubusercontent.com/u/8823366?v=3","gravatar_id":"","url":"https://api.github.com/users/robertmazzo","html_url":"https://github.com/robertmazzo","followers_url":"https://api.github.com/users/robertmazzo/followers","following_url":"https://api.github.com/users/robertmazzo/following{/other_user}","gists_url":"https://api.github.com/users/robertmazzo/gists{/gist_id}","starred_url":"https://api.github.com/users/robertmazzo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robertmazzo/subscriptions","organizations_url":"https://api.github.com/users/robertmazzo/orgs","repos_url":"https://api.github.com/users/robertmazzo/repos","events_url":"https://api.github.com/users/robertmazzo/events{/privacy}","received_events_url":"https://api.github.com/users/robertmazzo/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-08-12T21:12:19Z","updated_at":"2015-10-20T21:32:58Z","closed_at":"2015-10-20T21:32:58Z","body":"Hello Andy,\r\nI'm using Kendo UI chart widgets to render within your dashboard widgets. And everything is working out quite well for the most part.\r\nI do however switch out the widget content dynamically, which works fine when `widget.templateUrl` doesn't change. For example if I'm just switching from a `column chart` to a `bar chart`, I can just updated the widget's `dataModelOptions` property.\r\nIn this case I do something like this to switch a chart type:\r\n\r\n        $scope.result.dataModelOptions = {};         \r\n        $scope.result.dataModelOptions = chartOptions;  // my updated Kendo chart options\r\n\r\nHowever, if I need to reassign `widget.templateUrl` in order to fetch a different Html template, the widget doesn't refresh until I do a hard f5 refresh. Is it a ` scope.compileTemplate()` issue ? If so, how can I force that method ?\r\n\r\nFor example, if I switch from the `Kendo treelist` to a `Kendo treemap` then I have to use a different template file. So I do something like this :\r\n\r\n    if ($scope.widget.chartType == 'treemap') {     // TREEMAP\r\n                var treemapOptions = configureTreeMap(aggrJsonNew, colDefs, modelDef);\r\n                $scope.result.dataModelOptions = {};\r\n                $scope.result.dataModelOptions = treemapOptions;\r\n     }\r\n     if (newChartSelected) {  \r\n          // update some other properties\r\n          $scope.result.templateUrl = $scope.widget.templateUrl;  // ASSIGN NEW TEMPATE !!\r\n     }\r\n     $modalInstance.close($scope.result);\r\n     return;\r\n\r\nI would expect the Malhar framework to refresh/recompile the widget, but it doesn't. It actually renders the previous widget content. Then on the next hard refresh, my Kendo treemap looks good.\r\n\r\nPerhaps I need to manually `recompile` the widget, or `destroy` and then `add` again ?\r\n\r\nAdvice is appreciated...\r\n\r\nregards,\r\nBob\r\n"}}