# Webcomponents in Aurelia

**URL:** <https://discourse.aurelia.io/t/webcomponents-in-aurelia/368>\
**Category:** Help Requests\
**Created:** [November 13, 2017, 9:49am UTC](https://discourse.aurelia.io/t/webcomponents-in-aurelia/368 "2017-11-13T09:49:26Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![hadrienl](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/hadrienl/32/141_2.png) [@hadrienl](https://discourse.aurelia.io/u/hadrienl)\
**Post date:** [November 14, 2017, 8:46am UTC](https://discourse.aurelia.io/t/webcomponents-in-aurelia/368/4 "2017-11-14T08:46:52Z")

</div>

Here is what I tried to do with a aurelia-cli (requirejs) app:

components/test-custom.html

```auto
<script>
class TestCustom extends HTMLElement {
  static get observedAttributes() {return ['message']; }

  get message() {
    return this._message;
  }

  set message(message) {
    this._message = message;
    this.render();
  }

  constructor() {
    super();
    this.shadowDOM = this.attachShadow({mode: 'open'});
  }

  connectedCallback() {
    this.render();
  }

  attributeChangedCallback(attributeName, oldValue, newValue, namespace) {
    console.log(attributeName, newValue);
    this[attributeName] = newValue;
    this.render();
  }

  render() {
    this.shadowDOM.innerHTML = `
    <div style="background: red">
      <p>Hello ${this._message || ''}</p>
      <p><slot></slot></p>
    </div>
    `;
  }
}
customElements.define('test-custom', TestCustom);
</script>

```

app.html

```auto
<template>
<link
  rel="import"
  href="components/test-custom.html">
<input
  value.bind="message">
<test-custom
  message.bind="message">Pwet</test-custom>
</template>

```

The component is rendered, but the `message` attribute is never changed (`attributeChangedCallback` method is not called when changing `message` value from the input.

---

_[View the full topic](https://discourse.aurelia.io/t/webcomponents-in-aurelia/368)._
