File tree Expand file tree Collapse file tree 4 files changed +8
-6
lines changed Expand file tree Collapse file tree 4 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -17,8 +17,8 @@ mocking a browser dependency in non-browser environment tests:
1717angular .module (' demo' , []).value (' $document' , {});
1818```
1919
20- The wrapper also make accessible ` window.document ` directly in template scope
21- via ` ng-inject ` directive .
20+ When combined with ` ng-inject ` directive, the wrapper also makes ` document `
21+ object directly accessible in the template scope .
2222
2323#### Demo
2424
Original file line number Diff line number Diff line change @@ -17,8 +17,8 @@ mocking a browser dependency in non-browser environment tests:
1717angular .module (' demo' , []).value (' $window' , {});
1818```
1919
20- The wrapper also make accessible ` window ` directly in template scope via
21- ` ng-inject ` directive .
20+ When combined with ` ng-inject ` directive, the wrapper also makes ` window ` object
21+ directly accessible in the template scope .
2222
2323#### Demo
2424
Original file line number Diff line number Diff line change 11< section ng-app >
2- < div ng-inject ="$document "> Host {{ $document.location.host }}</ div >
2+ < div ng-inject ="$document ">
3+ `document.location.host` == < b > {{ $document.location.host }}</ b >
4+ </ div >
35</ section >
Original file line number Diff line number Diff line change 11< section ng-app >
22 < div ng-inject ="$window "> </ div >
3- < button ng-click ="$window.alert('click') "> Alert</ button >
3+ < button class =" btn btn-dark " ng-click ="$window.alert('click') "> Alert</ button >
44</ section >
You can’t perform that action at this time.
0 commit comments