May 8th, 2017
12:36 pm
Angular 2 -Difference between @Input and inputs in Angular2 Components?

Posted under Angular
Tags ,

This post discusses the alternative way of specifying input parameters for angular 2.

This can be done using either:-

@Component{(
    selector: "my-component",
    inputs: ["attr"]
)}
export class MyComponent {
}

or alternatively:-

@Component{(
    selector: "my-component"
)}
export class MyComponent {
    @Input()
    public attr: any;
}

No Comments »

Comments RSS

Leave a Reply

You must be logged in to post a comment.