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

Commit a5f6a92

Browse files
committed
docs(linky): update example to use a module
1 parent 282ed94 commit a5f6a92

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

src/ngSanitize/filter/linky.js

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,21 @@
2121
<span ng-bind-html="linky_expression | linky"></span>
2222
*
2323
* @example
24-
<example module="ngSanitize" deps="angular-sanitize.js">
24+
<example module="linkyExample" deps="angular-sanitize.js">
2525
<file name="index.html">
2626
<script>
27-
function Ctrl($scope) {
28-
$scope.snippet =
29-
'Pretty text with some links:\n'+
30-
'http://angularjs.org/,\n'+
31-
'mailto:us@somewhere.org,\n'+
32-
'another@somewhere.org,\n'+
33-
'and one more: ftp://127.0.0.1/.';
34-
$scope.snippetWithTarget = 'http://angularjs.org/';
35-
}
27+
angular.module('linkyExample', ['ngSanitize'])
28+
.controller('ExampleController', ['$scope', function($scope) {
29+
$scope.snippet =
30+
'Pretty text with some links:\n'+
31+
'http://angularjs.org/,\n'+
32+
'mailto:us@somewhere.org,\n'+
33+
'another@somewhere.org,\n'+
34+
'and one more: ftp://127.0.0.1/.';
35+
$scope.snippetWithTarget = 'http://angularjs.org/';
36+
}]);
3637
</script>
37-
<div ng-controller="Ctrl">
38+
<div ng-controller="ExampleController">
3839
Snippet: <textarea ng-model="snippet" cols="60" rows="3"></textarea>
3940
<table>
4041
<tr>

0 commit comments

Comments
 (0)