This repository was archived by the owner on Oct 26, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed
Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -9,9 +9,9 @@ function ExampleDirective() {
99 title : '@' ,
1010 message : '@exampleDirective'
1111 } ,
12- link : ( scope , element , attrs ) => {
12+ link : ( scope , element ) => {
1313 element . on ( 'click' , ( ) => {
14- alert ( 'Element clicked: ' + scope . message ) ;
14+ window . alert ( 'Element clicked: ' + scope . message ) ;
1515 } ) ;
1616 }
1717 } ;
Original file line number Diff line number Diff line change @@ -13,23 +13,23 @@ describe('Unit: ExampleDirective', function() {
1313 angular . mock . inject ( function ( $compile , $rootScope ) {
1414 scope = $rootScope ;
1515 element = angular . element ( '<div example-directive="{{message}}" title="{{title}}">Sample Directive</div>' ) ;
16- scope . title = " A sample title" ;
17- scope . message = " It doesn't hurt." ;
16+ scope . title = ' A sample title' ;
17+ scope . message = ' It doesn\ 't hurt.' ;
1818 $compile ( element ) ( scope ) ;
1919 scope . $digest ( ) ;
2020 } ) ;
2121 } ) ;
2222
2323 it ( 'should bind itself to the element' , function ( ) {
2424 element . triggerHandler ( 'click' ) ;
25- expect ( window . alert ) . toHaveBeenCalledWith ( " Element clicked: It doesn't hurt." ) ;
25+ expect ( window . alert ) . toHaveBeenCalledWith ( ' Element clicked: It doesn\ 't hurt.' ) ;
2626 } ) ;
2727
2828 it ( 'should update its bindings' , function ( ) {
29- scope . message = " It hurts a bit." ;
29+ scope . message = ' It hurts a bit.' ;
3030 scope . $digest ( ) ;
3131 element . triggerHandler ( 'click' ) ;
32- expect ( window . alert ) . toHaveBeenCalledWith ( " Element clicked: It hurts a bit." ) ;
32+ expect ( window . alert ) . toHaveBeenCalledWith ( ' Element clicked: It hurts a bit.' ) ;
3333 } ) ;
3434
3535 it ( 'should bind a title property to its template' , function ( ) {
You can’t perform that action at this time.
0 commit comments