mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-23 09:50:24 +00:00
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
This commit is contained in:
parent
4ab16aaaf7
commit
d7ed885984
1 changed files with 21 additions and 15 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue