Skip to content

Instantly share code, notes, and snippets.

@bigopon
Forked from sjarvela/index.html
Created June 2, 2021 06:43
Show Gist options
  • Save bigopon/b0803983cdb504a8d96e2fa9364d5ab6 to your computer and use it in GitHub Desktop.
Save bigopon/b0803983cdb504a8d96e2fa9364d5ab6 to your computer and use it in GitHub Desktop.

Revisions

  1. @sjarvela sjarvela revised this gist Mar 11, 2021. 9 changed files with 28 additions and 28 deletions.
    1 change: 1 addition & 0 deletions src\custom-element-a.html
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    <div style="color: red; border: 1px solid red">This is custom element A</div>
    6 changes: 6 additions & 0 deletions src\custom-element-a.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    import { customElement, bindable } from "aurelia";

    import template from "./custom-element-a.html";
    @customElement({ name: "custom-element-a", template })
    export class CustomElementA {
    }
    9 changes: 9 additions & 0 deletions src\custom-element-b.html
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    <import from="./custom-element-a"></import>

    <div style="border: 1px solid blue">
    <div style="color: blue">This is custom element B</div>

    <span>And here should be custom element A:</span>
    <custom-element-a></custom-element-a>
    <span>(but it is not rendered)</span>
    </div>
    6 changes: 6 additions & 0 deletions src\custom-element-b.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    import { customElement, bindable } from "aurelia";

    import template from "./custom-element-b.html";
    @customElement({ name: "custom-element-b", template })
    export class CustomElementB {
    }
    9 changes: 0 additions & 9 deletions src\my-another-custom-element.html
    Original file line number Diff line number Diff line change
    @@ -1,9 +0,0 @@
    <import from="./my-custom-element"></import>

    <div style="border: 1px solid blue">
    <div style="color: blue">This is from custom element B</div>

    <span>And here should be custom element A:</span>
    <my-custom-element></my-custom-element>
    <span>(but it is not rendered)</span>
    </div>
    6 changes: 0 additions & 6 deletions src\my-another-custom-element.js
    Original file line number Diff line number Diff line change
    @@ -1,6 +0,0 @@
    import { customElement, bindable } from "aurelia";

    import template from "./my-another-custom-element.html";
    @customElement({ name: "my-another-custom-element", template })
    export class MyAnotherCustomElement {
    }
    12 changes: 6 additions & 6 deletions src\my-app.html
    Original file line number Diff line number Diff line change
    @@ -1,10 +1,10 @@
    <import from="./my-custom-element"></import>
    <import from="./my-another-custom-element"></import>
    <import from="./custom-element-a"></import>
    <import from="./custom-element-b"></import>

    <h1>Custom elements</h1>

    <h2>Custom element directly under app</h2>
    <my-custom-element></my-custom-element>
    <h2>Custom element A directly under app</h2>
    <custom-element-a></custom-element-a>

    <h2>Custom element inside another custom element</h2>
    <my-another-custom-element></my-another-custom-element>
    <h2>Custom element A inside custom element B</h2>
    <custom-element-b></custom-element-b>
    1 change: 0 additions & 1 deletion src\my-custom-element.html
    Original file line number Diff line number Diff line change
    @@ -1 +0,0 @@
    <div style="color: red; border: 1px solid red">This is from custom element A</div>
    6 changes: 0 additions & 6 deletions src\my-custom-element.js
    Original file line number Diff line number Diff line change
    @@ -1,6 +0,0 @@
    import { customElement, bindable } from "aurelia";

    import template from "./my-custom-element.html";
    @customElement({ name: "my-custom-element", template })
    export class MyCustomElement {
    }
  2. @sjarvela sjarvela revised this gist Mar 11, 2021. 2 changed files with 3 additions and 3 deletions.
    4 changes: 2 additions & 2 deletions src\my-another-custom-element.html
    Original file line number Diff line number Diff line change
    @@ -1,9 +1,9 @@
    <import from="./my-custom-element"></import>

    <div style="border: 1px solid blue">
    <div style="color: blue">This is from another custom element</div>
    <div style="color: blue">This is from custom element B</div>

    <span>And here should be red "my-custom-element" inside "my-another-custom-element":</span>
    <span>And here should be custom element A:</span>
    <my-custom-element></my-custom-element>
    <span>(but it is not rendered)</span>
    </div>
    2 changes: 1 addition & 1 deletion src\my-custom-element.html
    Original file line number Diff line number Diff line change
    @@ -1 +1 @@
    <div style="color: red; border: 1px solid red">This is from custom element</div>
    <div style="color: red; border: 1px solid red">This is from custom element A</div>
  3. @sjarvela sjarvela revised this gist Mar 11, 2021. 2 changed files with 7 additions and 5 deletions.
    10 changes: 6 additions & 4 deletions src\my-another-custom-element.html
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,9 @@
    <import from="./my-custom-element"></import>

    <div style="color: blue">This is from another custom element</div>
    <div style="border: 1px solid blue">
    <div style="color: blue">This is from another custom element</div>

    <span>And here should be red "my-custom-element" inside "my-another-custom-element":</span>
    <my-custom-element></my-custom-element>
    <span>(but it is not rendered)</span>
    <span>And here should be red "my-custom-element" inside "my-another-custom-element":</span>
    <my-custom-element></my-custom-element>
    <span>(but it is not rendered)</span>
    </div>
    2 changes: 1 addition & 1 deletion src\my-custom-element.html
    Original file line number Diff line number Diff line change
    @@ -1 +1 @@
    <div style="color: red">This is from custom element</div>
    <div style="color: red; border: 1px solid red">This is from custom element</div>
  4. @sjarvela sjarvela created this gist Mar 10, 2021.
    19 changes: 19 additions & 0 deletions index.html
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>Dumber Gist</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no">
    <base href="/">
    </head>
    <!--
    Dumber Gist uses dumber bundler, the default bundle file
    is /dist/entry-bundle.js.
    The starting module is pointed to "main" (data-main attribute on script)
    which is your src/main.js.
    -->
    <body>
    <my-app></my-app>
    <script src="/dist/entry-bundle.js" data-main="main"></script>
    </body>
    </html>
    5 changes: 5 additions & 0 deletions package.json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    {
    "dependencies": {
    "aurelia": "latest"
    }
    }
    4 changes: 4 additions & 0 deletions src\main.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    import Aurelia from 'aurelia';
    import { MyApp } from './my-app';

    Aurelia.app(MyApp).start();
    7 changes: 7 additions & 0 deletions src\my-another-custom-element.html
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    <import from="./my-custom-element"></import>

    <div style="color: blue">This is from another custom element</div>

    <span>And here should be red "my-custom-element" inside "my-another-custom-element":</span>
    <my-custom-element></my-custom-element>
    <span>(but it is not rendered)</span>
    6 changes: 6 additions & 0 deletions src\my-another-custom-element.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    import { customElement, bindable } from "aurelia";

    import template from "./my-another-custom-element.html";
    @customElement({ name: "my-another-custom-element", template })
    export class MyAnotherCustomElement {
    }
    10 changes: 10 additions & 0 deletions src\my-app.html
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    <import from="./my-custom-element"></import>
    <import from="./my-another-custom-element"></import>

    <h1>Custom elements</h1>

    <h2>Custom element directly under app</h2>
    <my-custom-element></my-custom-element>

    <h2>Custom element inside another custom element</h2>
    <my-another-custom-element></my-another-custom-element>
    2 changes: 2 additions & 0 deletions src\my-app.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,2 @@
    export class MyApp {
    }
    1 change: 1 addition & 0 deletions src\my-custom-element.html
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    <div style="color: red">This is from custom element</div>
    6 changes: 6 additions & 0 deletions src\my-custom-element.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    import { customElement, bindable } from "aurelia";

    import template from "./my-custom-element.html";
    @customElement({ name: "my-custom-element", template })
    export class MyCustomElement {
    }