Skip to content

Instantly share code, notes, and snippets.

@dherges
Created October 11, 2017 18:29
Show Gist options
  • Save dherges/babd30bab2dd27f9855d269f71989dbf to your computer and use it in GitHub Desktop.
Save dherges/babd30bab2dd27f9855d269f71989dbf to your computer and use it in GitHub Desktop.
Angular: Componentful Functions
@Component({
selector: 'app-function-works',
templateUrl: './function-works.component.html',
styleUrls: ['./function-works.component.css']
})
export class FunctionWorksComponent implements OnInit {
message = 'foo';
constructor() { }
ngOnInit() {
this.message = 'bar';
}
sayHello() {
this.message = 'Hello World';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment