Skip to content

Commit 146c826

Browse files
committed
Update README.md
1 parent 263975e commit 146c826

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Inject module into your application
1616
angular.module('YourApp', ['linkify']);
1717
```
1818

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)
2020

2121
```html
2222
<!-- As a filter -->
@@ -36,18 +36,20 @@ User as a [AngularJS Filter](http://docs.angularjs.org/guide/dev_guide.templates
3636
<div ng-bind="someModel" linkify="twitter"></div>
3737
```
3838

39-
User as a service
39+
Inject as a [AngularJS Service](http://docs.angularjs.org/guide/dev_guide.services)
4040

4141
```javascript
4242
// Injected into controller
43-
angular.module('someModule').controller('SomeCtrl', function ($scope.linkify) {
43+
angular.module('someModule').controller('SomeCtrl', function ($scope, linkify) {
4444
var text = "@scottcorgan and http://github.com";
4545

4646
// Twitter
4747
$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>
4849

4950
// Github
5051
$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>
5153

5254
});
5355

0 commit comments

Comments
 (0)