Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

update ngBind.js documentation example #4427

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions src/ng/directive/ngBind.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,27 @@ var ngBindTemplateDirective = ['$interpolate', function($interpolate) {
*
* @element ANY
* @param {expression} ngBindHtml {@link guide/expression Expression} to evaluate.
*
* @example
* Try it here: enter text in text box and watch the greeting change.
<doc:example>
<doc:source>
<script>
function Ctrl($scope) {
$scope.myHTML = 'I am an <code>HTML</code>string with <a ng-href="#'>links!</a> and other <em>stuff</em>';
}
</script>
<div ng-controller="Ctrl">
<p ng-bind-html="myHTML"></p>
</div>
</doc:source>
<doc:scenario>
it('should check ng-bind-html', function() {
expect(using('.doc-example-live').binding('myHTML')).
toBe('I am an <code>HTML</code>string with <a ng-href="#'>links!</a> and other <em>stuff</em>');
});
</doc:scenario>
</doc:example>
*/
var ngBindHtmlDirective = ['$sce', '$parse', function($sce, $parse) {
return function(scope, element, attr) {
Expand Down