I have some legacy code that injects into the DOM (a dialog) and I'm trying to rewrite some of the jQuery logic to work with angular data binding.
This HTML is injected outside of an angular controller (jquery UI dialog), like so:
// Get jQuery to load the static content into the page
$.get(windowFile, data => {
$(windowName).html(data);
this.ready();
that.toggleVisibility();
});
The HTML defines an ngController:
<div ng-controller="inventoryController">
However, just injecting it into the DOM isn't enough. The controller is never initialized. I can modify the opening code a bit.
How can I get the controller to be initialized when injected?