Reputation: 202
Is it possible to load nested partials with forms inside to the partial tabs such as:
<ng-include src="'form_group.html'"></ng-include>
Another issue is that the expressions {{}} are not binding to the actual output, am I missing something? I wanted to retain the two-way binding of the expression and scopes of the text partial contents in the Controller.
Upvotes: 1
Views: 155
Reputation: 20751
Try out this
app.directive('bindHtmlUnsafe', function( $parse, $compile ) {
return function( $scope, $element, $attrs ) {
var compile = function( newHTML ) {
newHTML = $compile(newHTML)($scope);
$element.html('').append(newHTML);
};
var htmlName = $attrs.bindHtmlUnsafe;
$scope.$watch(htmlName, function( newHTML ) {
if(!newHTML) return;
compile(newHTML);
});
};
});
Upvotes: 1