So, a little background on this, I have an AngularJS/Ionic project that I'm attempting to do some improvement on, I'm placing all my HTML/JS/CSS into a database table, which in turn will be retrieved on a GET upon app start. HTML is then saved in a factory(also local storage). The goal, is to have an app that can be controlled from the HTML/JS/CSS that is within the Database table, so that we don't need to redeploy new versions for simple updates/fixes. Here's what I have tried:
The most successful method I used was using the below within the controller:
$scope.pageContent = $sce.trustAsHtml(htmlString)
and calling it within the HTML like below:
<div ng-bind-html="pagecontent"></div>
The only problem is, that it isn't compiling correct in a few ways - All my $scope values within the HTML aren't being linked to the parent controller scope.
My questions is: Is there a better way of handling this? I've seen a few people claiming using directives would be the way to go, but can't get a definitive answer on how to implement. Or, is how I'm moving forward working, and I'm just missing some key components... Any help on best way to implement would be greatly appreciated. Let me know if I left any information out, thanks!