Skip to content

Instantly share code, notes, and snippets.

@krawaller
Created July 25, 2017 14:31
Show Gist options
  • Save krawaller/73f17bee49f34cac8e7ec1138c9ba4ca to your computer and use it in GitHub Desktop.
Save krawaller/73f17bee49f34cac8e7ec1138c9ba4ca to your computer and use it in GitHub Desktop.

Revisions

  1. krawaller created this gist Jul 25, 2017.
    23 changes: 23 additions & 0 deletions components.ts
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,23 @@
    import { Component, Input } from '@angular/core';

    @Component({
    selector: 'app',
    template: `
    <table>
    <tr magicrow msg="hello"></tr>
    <tr magicrow msg="world"></tr>
    </table>
    `,
    })
    export class AppComponent {}


    @Component({
    selector: 'tr[magicrow]',
    template: `
    <td>{{msg}}</td>
    `
    })
    export class RowComponent {
    @Input() msg: string
    }
    14 changes: 14 additions & 0 deletions main.ts
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    import { NgModule } from '@angular/core';
    import { BrowserModule } from '@angular/platform-browser';
    import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';

    import { AppComponent, RowComponent } from './components';

    @NgModule({
    imports: [ BrowserModule ],
    declarations: [ AppComponent, RowComponent ],
    bootstrap: [ AppComponent ]
    })
    class AppModule {}

    platformBrowserDynamic().bootstrapModule(AppModule);