I have the following controller
app.controller('PageController', ['$scope', '$http', 'PageService', '$sce', function($scope, $http, PageService, $sce) {
////////changetab is ng-click event
$scope.changetab = function(url) {
PageService.http.get(app.genurl(url)).success(function(data) {
$scope.datas = $sce.trustAsHtml(data);
})
}
}])
ng-bind-html will load the dynamic templates which holds another controller
<div ng-controller="PageController">
<div ng-bind-html="datas"></div>
</div>
Here is the controller for dynamic template
app.controller('AboutController', ['$scope', function($scope) {
$scope.disname = 'Relicset';
}])
Here is the html template loaded dynamically
<div ng-controller="AboutController">
{{ disname }}
</div>
Problem is in aboutcontroller disname is not printing as Relicset instead showing {{ disname }} How to handle such case.
ng-include
– Chandermani May 22 at 16:53