Skip to content

Instantly share code, notes, and snippets.

@sjarvela
Last active December 19, 2021 12:23
Show Gist options
  • Select an option

  • Save sjarvela/d93c8c3e37cdfb7a40e25a1b115faded to your computer and use it in GitHub Desktop.

Select an option

Save sjarvela/d93c8c3e37cdfb7a40e25a1b115faded to your computer and use it in GitHub Desktop.

Revisions

  1. sjarvela revised this gist Dec 19, 2021. 1 changed file with 0 additions and 2 deletions.
    2 changes: 0 additions & 2 deletions src\my-app.html
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,3 @@
    <import from="./custom-element-a"></import>

    <h1>Dialog</h1>

    <button>Open dialog</button>
  2. sjarvela revised this gist Dec 19, 2021. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion src\my-app.html
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,4 @@
    <import from="./custom-element-a"></import>
    <import from="./custom-element-b"></import>

    <h1>Dialog</h1>

  3. sjarvela revised this gist Nov 8, 2021. 1 changed file with 11 additions and 0 deletions.
    11 changes: 11 additions & 0 deletions src\my-app.js
    Original file line number Diff line number Diff line change
    @@ -1,2 +1,13 @@
    import {
    DialogService,
    DialogDeactivationStatuses,
    } from "@aurelia/runtime-html";

    @inject(DialogService)
    export class MyApp {
    ds;

    constructor(ds) {
    this.ds = ds;
    }
    }
  4. sjarvela revised this gist Nov 8, 2021. 4 changed files with 4 additions and 17 deletions.
    8 changes: 0 additions & 8 deletions src\custom-element-b.html
    Original file line number Diff line number Diff line change
    @@ -1,8 +0,0 @@
    <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 is custom element A inside B:</span>
    <custom-element-a></custom-element-a>
    </div>
    2 changes: 0 additions & 2 deletions src\custom-element-b.js
    Original file line number Diff line number Diff line change
    @@ -1,2 +0,0 @@
    export class CustomElementB {
    }
    3 changes: 2 additions & 1 deletion src\main.js
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,5 @@
    import Aurelia from 'aurelia';
    import { DialogDefaultConfiguration } from '@aurelia/runtime-html';
    import { MyApp } from './my-app';

    Aurelia.app(MyApp).start();
    Aurelia.register(DialogDefaultConfiguration).app(MyApp).start();
    8 changes: 2 additions & 6 deletions src\my-app.html
    Original file line number Diff line number Diff line change
    @@ -1,10 +1,6 @@
    <import from="./custom-element-a"></import>
    <import from="./custom-element-b"></import>

    <h1>Custom elements</h1>
    <h1>Dialog</h1>

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

    <h2>Custom element A inside custom element B</h2>
    <custom-element-b></custom-element-b>
    <button>Open dialog</button>
  5. sjarvela created this gist Nov 8, 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"
    }
    }
    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>
    2 changes: 2 additions & 0 deletions src\custom-element-a.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,2 @@
    export class CustomElementA {
    }
    8 changes: 8 additions & 0 deletions src\custom-element-b.html
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    <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 is custom element A inside B:</span>
    <custom-element-a></custom-element-a>
    </div>
    2 changes: 2 additions & 0 deletions src\custom-element-b.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,2 @@
    export class CustomElementB {
    }
    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();
    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="./custom-element-a"></import>
    <import from="./custom-element-b"></import>

    <h1>Custom elements</h1>

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

    <h2>Custom element A inside custom element B</h2>
    <custom-element-b></custom-element-b>
    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 {
    }