• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

I Like Kill Nerds

The blog of Australian Front End / Aurelia Javascript Developer & brewing aficionado Dwayne Charrington // Aurelia.io Core Team member.

  • Home
  • Aurelia 2
  • Aurelia 1
  • About
  • Aurelia 2 Consulting/Freelance Work

How to Stop Aurelia 2 From Stripping Your Aurelia Attributes From the Compiled HTML

Aurelia 2 · November 1, 2021

In Aurelia 1, you could debug and identify Aurelia applications based on specific attributes in the dom. In Aurelia 2, the default setting for compiled HTML is to strip away Aurelia framework attributes.

What this means is if you need to debug your HTML, see what custom attributes are being passed to a custom element, and so on, you won’t see anything.

Like everything in Aurelia, you can customise this. Inside your main.ts file, you can set debug mode to true to bring back the Aurelia specific HTML attributes and markup.

import Aurelia, { ITemplateCompiler } from 'aurelia';

Aurelia
  .register(
    AppTask.beforeCreate(ITemplateCompiler, compiler => compiler.debug = true),
  )

This will make it, so your dom is noisy again. Just remember to turn it off once you’re done. It will prevent the dom from bloating and introduce potential performance issues due to an excessive size page.

Dwayne

Leave a Reply Cancel reply

0 Comments
Inline Feedbacks
View all comments

Primary Sidebar

Popular

  • Thoughts on the Flipper Zero
  • Testing Event Listeners In Jest (Without Using A Library)
  • How To Get The Hash of A File In Node.js
  • How To Paginate An Array In Javascript
  • Waiting for an Element to Exist With JavaScript
  • Reliably waiting for network responses in Playwright
  • How To Get Last 4 Digits of A Credit Card Number in Javascript
  • How to Use Neural DSP Archetype Plugins With the Quad Cortex
  • Neural DSP Reveal Details About the Long-Awaited Quad Cortex Desktop Editor
  • How to Copy Files Using the Copy Webpack Plugin (without copying the entire folder structure)

Recent Comments

  • Kevmeister68 on Start-Ups and Companies That Embrace Work From Anywhere Will Be More Likely to Survive the Coming Recession in 2023
  • kevmeister68 on What Would Get People Back Into the Office?
  • Dwayne on PHP Will Not Die
  • Dwayne on How to Create a Blockchain With TypeScript
  • kevmeister68 on PHP Will Not Die

Copyright © 2023 · Dwayne Charrington · Log in

wpDiscuz