You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+5-3Lines changed: 5 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ Inject module into your application
16
16
angular.module('YourApp', ['linkify']);
17
17
```
18
18
19
-
User as a [AngularJS Filter](http://docs.angularjs.org/guide/dev_guide.templates.filters.using_filters) or [AngularJS Directive](http://docs.angularjs.org/guide/directive)
19
+
Use as a [AngularJS Filter](http://docs.angularjs.org/guide/dev_guide.templates.filters.using_filters) or [AngularJS Directive](http://docs.angularjs.org/guide/directive)
20
20
21
21
```html
22
22
<!-- As a filter -->
@@ -36,18 +36,20 @@ User as a [AngularJS Filter](http://docs.angularjs.org/guide/dev_guide.templates
36
36
<divng-bind="someModel"linkify="twitter"></div>
37
37
```
38
38
39
-
User as a service
39
+
Inject as a [AngularJS Service](http://docs.angularjs.org/guide/dev_guide.services)
40
40
41
41
```javascript
42
42
// Injected into controller
43
-
angular.module('someModule').controller('SomeCtrl', function ($scope.linkify) {
43
+
angular.module('someModule').controller('SomeCtrl', function ($scope, linkify) {
44
44
var text ="@scottcorgan and http://github.com";
45
45
46
46
// Twitter
47
47
$scope.text=linkify.twitter(text);
48
+
// outputs: <a href="https://twitter.com/scottcorgan" target="_blank">scottcorgan</a> and <a href="http://github.com" target="_blank">http://github.com</a>
48
49
49
50
// Github
50
51
$scope.text=linkify.github(text);
52
+
// outputs: <a href="https://github.com/scottcorgan" target="_blank">scottcorgan</a> and <a href="http://github.com" target="_blank">http://github.com</a>
0 commit comments