1

I'm trying to use angular to reload (or 'livechange') content - the content default structure isn't created by angular. so i have the following

<div>Default Value</div>

and i want to be able to rebuild the content with angular (ng-bind-html is a great solution, but it cant use 'default' value).

Any help would be appreciated. thanks!

1 Answer 1

1

You can do that using ng-hide/ng-show directive please see here http://plnkr.co/edit/oHJMD6UU3xOOg5HZo3IC?p=preview

<body ng-controller="MainCtrl">

  <textarea name="comment" ng-model="myHTML"></textarea>
  <div ng-bind-html="myHTML" ng-show="myHTML"></div>
  <div ng-hide="myHTML">Default Value</div>
</body>
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks, i didn't want to do manipulation that way. my main idea is to leave the html as is and make the manipulation through angular. what i did at the end is using $event.target.innerHTML

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.