New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Directive's content as bound data #77
Comments
use ngModel. see https://github.com/summernote/angular-summernote#ngmodel |
I'm sorry it was not what I meant. Let's say that, when the page loads, my summernote element already has some content. Something like: <summernote>
<p>Hello World</p>
</summernote> When the directive is loaded, |
@thomaslhostis |
@outsideris <summernote ng-model="text" ng-init="text='<p>Hello World</p>'"></summernote> But I'd rather be able to do this: <summernote><p>Hello World</p></summernote> Is it possible, with your directive as it is, to easily do that? |
@outsideris ...
template: '<div class="summernote" ng-transclude></div>'
... If you define a ng-model and set its value, it takes over the directive's HTML content. So I'm wondering, is there a reason why you didn't use ng-transclude? This is great work, by the way. |
@thomaslhostis |
Sure, I'll create a PR :-) "Transclude is a setting to tell angular to capture everything that is put inside the directive in the markup and use it somewhere in the directive's template." http://stackoverflow.com/questions/24725399/what-is-ng-transclude |
Great!! 😄 |
Is there a way to automatically bind the directive's html content to the data?
The text was updated successfully, but these errors were encountered: