aboutsummaryrefslogtreecommitdiffstats
path: root/src/ng/directive/ngBind.js
diff options
context:
space:
mode:
authorPete Bacon Darwin2013-11-14 12:07:01 +0000
committerPete Bacon Darwin2013-11-14 12:28:53 +0000
commitd7ed885984d58d344350ae267f51e8096bb6bea6 (patch)
treeaec9a5f2815ff7c52c03e81ae80f079dcc6793b3 /src/ng/directive/ngBind.js
parent4ab16aaaf762e9038803da1f967ac8cb6650727d (diff)
downloadangular.js-d7ed885984d58d344350ae267f51e8096bb6bea6.tar.bz2
docs(ngBindHtml): fix dependency for Plunker and JSFiddle in example
The `<doc:example>` directive does not load up the dependencies correctly. Using the `<example>` directive, with `<file>` elements fixes this. Closes #4951
Diffstat (limited to 'src/ng/directive/ngBind.js')
-rw-r--r--src/ng/directive/ngBind.js36
1 files changed, 21 insertions, 15 deletions
diff --git a/src/ng/directive/ngBind.js b/src/ng/directive/ngBind.js
index 2ba50928..ecfc8ab6 100644
--- a/src/ng/directive/ngBind.js
+++ b/src/ng/directive/ngBind.js
@@ -138,27 +138,33 @@ var ngBindTemplateDirective = ['$interpolate', function($interpolate) {
* @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 module="ngBindHtmlExample" deps="angular-sanitize.js" >
- <doc:source>
- <script>
- angular.module('ngBindHtmlExample', ['ngSanitize'])
-
- .controller('ngBindHtmlCtrl', ['$scope', function ngBindHtmlCtrl($scope) {
- $scope.myHTML = 'I am an <code>HTML</code>string with <a href="#">links!</a> and other <em>stuff</em>';
- }]);
- </script>
+ Try it here: enter text in text box and watch the greeting change.
+
+ <example module="ngBindHtmlExample" deps="angular-sanitize.js">
+ <file name="index.html">
<div ng-controller="ngBindHtmlCtrl">
<p ng-bind-html="myHTML"></p>
</div>
- </doc:source>
- <doc:scenario>
+ </file>
+
+ <file name="script.js">
+ angular.module('ngBindHtmlExample', ['ngSanitize'])
+
+ .controller('ngBindHtmlCtrl', ['$scope', function ngBindHtmlCtrl($scope) {
+ $scope.myHTML =
+ 'I am an <code>HTML</code>string with <a href="#">links!</a> and other <em>stuff</em>';
+ }]);
+ </file>
+
+ <file name="scenario.js">
it('should check ng-bind-html', function() {
expect(using('.doc-example-live').binding('myHTML')).
- toBe('I am an <code>HTML</code>string with <a href="#">links!</a> and other <em>stuff</em>');
+ toBe(
+ 'I am an <code>HTML</code>string with <a href="#">links!</a> and other <em>stuff</em>'
+ );
});
- </doc:scenario>
- </doc:example>
+ </file>
+ </example>
*/
var ngBindHtmlDirective = ['$sce', '$parse', function($sce, $parse) {
return function(scope, element, attr) {