File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -136,6 +136,29 @@ var ngBindTemplateDirective = ['$interpolate', function($interpolate) {
136
136
*
137
137
* @element ANY
138
138
* @param {expression } ngBindHtml {@link guide/expression Expression } to evaluate.
139
+ *
140
+ * @example
141
+ * Try it here: enter text in text box and watch the greeting change.
142
+ <doc:example module="ngBindHtmlExample" deps="angular-sanitize.js" >
143
+ <doc:source>
144
+ <script>
145
+ angular.module('ngBindHtmlExample', ['ngSanitize'])
146
+
147
+ .controller('ngBindHtmlCtrl', ['$scope', function ngBindHtmlCtrl($scope) {
148
+ $scope.myHTML = 'I am an <code>HTML</code>string with <a href="#">links!</a> and other <em>stuff</em>';
149
+ }]);
150
+ </script>
151
+ <div ng-controller="ngBindHtmlCtrl">
152
+ <p ng-bind-html="myHTML"></p>
153
+ </div>
154
+ </doc:source>
155
+ <doc:scenario>
156
+ it('should check ng-bind-html', function() {
157
+ expect(using('.doc-example-live').binding('myHTML')).
158
+ toBe('I am an <code>HTML</code>string with <a href="#">links!</a> and other <em>stuff</em>');
159
+ });
160
+ </doc:scenario>
161
+ </doc:example>
139
162
*/
140
163
var ngBindHtmlDirective = [ '$sce' , '$parse' , function ( $sce , $parse ) {
141
164
return function ( scope , element , attr ) {
You can’t perform that action at this time.
0 commit comments