Skip to content

Instantly share code, notes, and snippets.

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