@@ -363,15 +363,13 @@ module('setupRenderingContext', function (hooks) {
363363 this . owner . register (
364364 'component:x-foo' ,
365365 setComponentTemplate (
366- hbs `<button {{action 'clicked' }}>Click me!</button>` ,
366+ hbs `<button {{on 'click' this.clicked }}>Click me!</button>` ,
367367
368- Component . extend ( {
369- actions : {
370- clicked ( ) {
371- assert . ok ( true , 'click was fired' ) ;
372- } ,
373- } ,
374- } )
368+ class extends Component {
369+ clicked = ( ) => {
370+ assert . ok ( true , 'click was fired' ) ;
371+ } ;
372+ }
375373 )
376374 ) ;
377375
@@ -391,7 +389,7 @@ module('setupRenderingContext', function (hooks) {
391389 this . owner . register (
392390 'component:x-foo' ,
393391 setComponentTemplate (
394- hbs `<button onclick={{action @clicked}}>Click me!</button>` ,
392+ hbs `<button {{on 'click' @clicked}}>Click me!</button>` ,
395393 Component . extend ( )
396394 )
397395 ) ;
@@ -410,7 +408,7 @@ module('setupRenderingContext', function (hooks) {
410408 test ( 'can pass function to be used as a "closure action" to a template only component' , async function ( assert ) {
411409 assert . expect ( 2 ) ;
412410
413- let template = hbs `<button onclick={{action @clicked}}>Click me!</button>` ;
411+ let template = hbs `<button onclick={{@clicked}}>Click me!</button>` ;
414412
415413 this . owner . register (
416414 'component:x-foo' ,
@@ -492,14 +490,12 @@ module('setupRenderingContext', function (hooks) {
492490 this . owner . register (
493491 'component:my-component' ,
494492 setComponentTemplate (
495- hbs `<button {{action 'clicked'}}>{{this.foo}}</button>` ,
496- Component . extend ( {
497- actions : {
498- clicked ( ) {
499- this . set ( 'foo' , 'updated!' ) ;
500- } ,
501- } ,
502- } )
493+ hbs `<button {{on 'click' this.clicked}}>{{this.foo}}</button>` ,
494+ class extends Component {
495+ clicked = ( ) => {
496+ this . set ( 'foo' , 'updated!' ) ;
497+ } ;
498+ }
503499 )
504500 ) ;
505501
@@ -524,15 +520,13 @@ module('setupRenderingContext', function (hooks) {
524520 this . owner . register (
525521 'component:my-component' ,
526522 setComponentTemplate (
527- hbs `<button {{action 'clicked'}}>{{this.foo}}</button>` ,
528- Component . extend ( {
529- actions : {
530- clicked ( ) {
531- this . set ( 'foo' , 'updated!' ) ;
532- this . set ( 'bar' , 'updated bar!' ) ;
533- } ,
534- } ,
535- } )
523+ hbs `<button {{on 'click' this.clicked}}>{{this.foo}}</button>` ,
524+ class extends Component {
525+ clicked = ( ) => {
526+ this . set ( 'foo' , 'updated!' ) ;
527+ this . set ( 'bar' , 'updated bar!' ) ;
528+ } ;
529+ }
536530 )
537531 ) ;
538532
0 commit comments