Skip to content

Instantly share code, notes, and snippets.

@riconegri
Created August 31, 2018 15:46
Show Gist options
  • Save riconegri/7a6934ebebc61d69a11c3acf94f91fb0 to your computer and use it in GitHub Desktop.
Save riconegri/7a6934ebebc61d69a11c3acf94f91fb0 to your computer and use it in GitHub Desktop.
angular cmp to external load
import { BrowserModule } from '@angular/platform-browser';
import { NgModule, Component } from '@angular/core';
@Component({
selector: 'app-component',
template: `
<button (click)="oi('oi')">{{button}}</button>
`
})
class AppComponent{
oi;
button = 'click me';
oi(oi) {
this.oi = oi;
this.button = this.oi;
console.log(oi);
}
}
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment