File tree Expand file tree Collapse file tree
transforms/angle-brackets Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -262,12 +262,16 @@ function transformNodeAttributes(tagName, node) {
262262 return node . params . concat ( attributes ) ;
263263}
264264
265+ function isDataAttrPathExpression ( node ) {
266+ return node . type === 'PathExpression' && node . original . startsWith ( 'data-' ) ;
267+ }
268+
265269function getDataAttributesFromParams ( params ) {
266- return params . filter ( param => param . original && ` ${ param . original } ` . startsWith ( 'data-' ) ) ;
270+ return params . filter ( it => isDataAttrPathExpression ( it ) ) ;
267271}
268272
269273function getNonDataAttributesFromParams ( params ) {
270- return params . filter ( p => ! ( p . original && ` ${ p . original } ` . startsWith ( 'data-' ) ) ) ;
274+ return params . filter ( it => ! isDataAttrPathExpression ( it ) ) ;
271275}
272276
273277function shouldIgnoreMustacheStatement ( fullName , config , invokableData ) {
Original file line number Diff line number Diff line change @@ -376,6 +376,7 @@ test('let', () => {
376376test ( 'link-to' , ( ) => {
377377 let input = `
378378 {{#link-to "about"}}About Us{{/link-to}}
379+ {{#link-to "data-access"}}Accessing the Crates.io Data{{/link-to}}
379380 {{#link-to this.dynamicRoute}}About Us{{/link-to}}
380381 {{#link-to "user" this.first this.second}}Show{{/link-to}}
381382 {{#link-to "user" this.first this.second (query-params foo="baz")}}Show{{/link-to}}
@@ -386,6 +387,7 @@ test('link-to', () => {
386387 expect ( runTest ( 'link-to.hbs' , input ) ) . toMatchInlineSnapshot ( `
387388 "
388389 <LinkTo @route=\\"about\\">About Us</LinkTo>
390+ <LinkTo @route=\\"data-access\\">Accessing the Crates.io Data</LinkTo>
389391 <LinkTo @route={{this.dynamicRoute}}>About Us</LinkTo>
390392 <LinkTo @route=\\"user\\" @models={{array this.first this.second}}>Show</LinkTo>
391393 <LinkTo @route=\\"user\\" @models={{array this.first this.second}} @query={{hash foo=\\"baz\\"}}>Show</LinkTo>
You can’t perform that action at this time.
0 commit comments